diff --git a/src/app/(campaign)/campanha/(app)/comunicacao/acervo/page.tsx b/src/app/(campaign)/campanha/(app)/comunicacao/acervo/page.tsx index 70837fe1..d172d148 100644 --- a/src/app/(campaign)/campanha/(app)/comunicacao/acervo/page.tsx +++ b/src/app/(campaign)/campanha/(app)/comunicacao/acervo/page.tsx @@ -3,6 +3,7 @@ import { ScissorsIcon, SearchIcon, SearchXIcon, VideoIcon } from 'lucide-react' import Link from 'next/link' import { redirect } from 'next/navigation' import { getPayload } from 'payload' +import type { ReactNode } from 'react' import { RecordingAcervoFilters } from '@/components/campaign/recording/RecordingAcervoFilters' import { RecordingResultList } from '@/components/campaign/recording/RecordingResultList' @@ -89,6 +90,50 @@ const AcervoHeader = ({ source }: { source: AcervoSource }) => ( ) +/** + * C216 — the results heading every source repeats: the theme ladder (exact + * term / theme / idle) and the hint line of `mode=tema`. The caller owns the + * right side (`controls`: the Câmara leaves the retry button bare, the other + * two wrap it with their sort select) and whether the row renders at all. + */ +const AcervoResultsHeading = ({ + themeMode, + themeActive, + themeUnavailable, + idleTitle, + subject, + controls, +}: { + themeMode: boolean + themeActive: boolean + themeUnavailable: boolean + idleTitle: string + subject: 'fala' | 'gravação' + controls: ReactNode +}) => ( +
+
+

+ {themeUnavailable + ? 'Resultados por termo exato' + : themeActive + ? 'Resultados por tema' + : idleTitle} +

+ {themeMode ? ( +

+ {themeUnavailable + ? 'Comportamento atual do acervo.' + : themeActive + ? `Confira o indício em cada ${subject} antes de abrir.` + : 'Nenhum termo relacionado foi acrescentado; mostramos a busca literal.'} +

+ ) : null} +
+ {controls} +
+) + const RecordingsSource = ({ data, }: { @@ -114,33 +159,22 @@ const RecordingsSource = ({ /> -
-
-

- {data.themeUnavailable - ? 'Resultados por termo exato' - : themeActive - ? 'Resultados por tema' - : 'Gravações encontradas'} -

- {themeMode ? ( -

- {data.themeUnavailable - ? 'Comportamento atual do acervo.' - : themeActive - ? 'Confira o indício em cada gravação antes de abrir.' - : 'Nenhum termo relacionado foi acrescentado; mostramos a busca literal.'} -

- ) : null} -
-
- {data.themeUnavailable ? : null} - -
-
+ + {data.themeUnavailable ? : null} + + + } + /> {data.rows.length > 0 ? ( @@ -236,33 +270,22 @@ const WebSpeechesSource = ({ {data.themeUnavailable ? : null} -
-
-

- {data.themeUnavailable - ? 'Resultados por termo exato' - : themeActive - ? 'Resultados por tema' - : 'Resultados encontrados'} -

- {themeMode ? ( -

- {data.themeUnavailable - ? 'Comportamento atual do acervo.' - : themeActive - ? 'Confira o indício em cada fala antes de abrir.' - : 'Nenhum termo relacionado foi acrescentado; mostramos a busca literal.'} -

- ) : null} -
-
- {data.themeUnavailable ? : null} - -
-
+ + {data.themeUnavailable ? : null} + + + } + /> {data.rows.length > 0 ? ( @@ -343,25 +366,14 @@ const CamaraSource = ({ data }: { data: Awaited {themeMode ? ( -
-
-

- {data.themeUnavailable - ? 'Resultados por termo exato' - : themeActive - ? 'Resultados por tema' - : 'Resultados'} -

-

- {data.themeUnavailable - ? 'Comportamento atual do acervo.' - : themeActive - ? 'Confira o indício em cada fala antes de abrir.' - : 'Nenhum termo relacionado foi acrescentado; mostramos a busca literal.'} -

-
- {data.themeUnavailable ? : null} -
+ : null} + /> ) : null} {data.rows.length > 0 ? (