)
}
/**
* The primary CTA of every result card: a link to the speech (or its trecho)
* whose variant/width the caller owns (C229 adds the theme appearance).
*/
const SpeechWatchButton = ({
speech,
watchLabel,
variant,
className,
}: {
speech: SpeechListItemViewModel
watchLabel: string
variant: 'default' | 'outline'
className: string
}) => (
)
const SpeechActions = ({
speech,
className,
fullWidthOnMobile = false,
}: {
speech: SpeechListItemViewModel
className: string
fullWidthOnMobile?: boolean
}) => (
{speech.officialTextUrl ? (
Abrir Diário Oficial
) : null}
)
export const SpeechResultCard = ({
speech,
query,
}: {
speech: SpeechListItemViewModel
/** C174 — the search term, highlighted on the nested cuts. */
query?: string
}) => {
// C174 (option B): a speech that surfaced only because a cut matched the term
// shows the origin note instead of an excerpt the speech does not contain, and
// the actions sit at the top right (approved scene 05). C229 — a semantic
// result outranks this branch: the evidence lives in the speech itself.
if (!speech.matchedTextSearch && !speech.semanticMatch) {
return (
{speech.literalFallback ? (
) : null}
A fala não contém o termo exato; ela aparece porque um corte vinculado corresponde à
busca.
{speech.cuts.length ? (
) : null}
)
}
const chipGroups: SpeechChipGroup[] = [
{ key: 'topics', items: speech.topics, max: MAX_TOPIC_CHIPS },
{ key: 'scopes', items: speech.scopes, max: MAX_SCOPE_CHIPS },
{
key: 'keywords',
items: speech.keywords.map((keyword) => ({ value: keyword, label: keyword })),
max: MAX_KEYWORD_CHIPS,
variant: 'outline',
className: 'font-normal text-muted-foreground',
},
]
const isTheme = speech.semanticMatch
// C229 — a semantic card only offers the trecho seek when the speech really
// contains the literal query (a stopword-only segment hit must not claim it).
const watchLabel =
speech.matchKind === 'segment' && speech.matchedTextSearch ? 'Assistir no trecho' : 'Ver fala'
// C229 — the semantic card replaces the common excerpt with the evidence
// block; the two never coexist (design gate).
const bodyNode = isTheme ? (
) : (
)
const chips =
const hasChips = Boolean(speech.topics.length || speech.scopes.length || speech.keywords.length)
return (
{isTheme ? (
) : (
{speech.literalFallback ? (
) : null}
)}
{speech.thumbnailUrl ? (
{bodyNode}
) : (
bodyNode
)}
{isTheme ? (
{hasChips ?
{chips}
: }
{speech.officialTextUrl ? (
Abrir Diário Oficial
) : null}
) : (
<>
{hasChips ?
{chips}
: null}
{speech.officialTextUrl ? (
Abrir Diário Oficial
) : null}