teqo-backup/src/components/campaign/speech/SpeechCutOriginCard.tsx
Francisco Solla 77216481d8 feat(C168): biblioteca de cortes no acervo (origem, download, compartilhar, editar texto)
Lista + detalhe em /campanha/comunicacao/acervo/cortes: busca por título/descrição,\norigem da fala, player do MP4, edição de título/descrição e kill switch de\npublicar/despublicar no mesmo /corte/<id>. Gate speechCatalog fail-closed para\nadvisor/leader. Sem collection/migration nova.
2026-09-15 12:56:51 -03:00

33 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from 'next/link'
import { formatSpeechClock } from '@/lib/speechClock'
import type { SpeechCutLibraryItemViewModel } from '@/lib/speechCut'
/**
* C168 — context of the cut: which speech it came from and the stored excerpt
* span, with the link back to the acervo. Degrades honestly when the source
* speech was deleted (the FK is `SET NULL`) — the cut itself stays usable.
*/
export const SpeechCutOriginCard = ({ cut }: { cut: SpeechCutLibraryItemViewModel }) => (
<section className="rounded-xl border p-4">
<h2 className="text-xs tracking-wide text-muted-foreground uppercase">Discurso de origem</h2>
{cut.origin ? (
<>
<p className="mt-1.5 text-sm text-foreground/90">{cut.origin.label}</p>
<p className="mt-1 text-xs text-muted-foreground">
Trecho {formatSpeechClock(cut.startSeconds)}–{formatSpeechClock(cut.endSeconds)} da fala
</p>
<Link
href={cut.origin.href}
className="mt-2 inline-flex min-h-11 items-center text-sm underline underline-offset-4 hover:text-foreground"
>
Ver fala no acervo
</Link>
</>
) : (
<p className="mt-1.5 text-sm text-muted-foreground">
A fala de origem não está mais disponível. O corte continua salvo e compartilhável.
</p>
)}
</section>
)