'use client' import { SparklesIcon, TriangleAlertIcon } from 'lucide-react' import { cn } from '@/lib/utils' import type { SpeechSearchMode } from '@/utilities/speech/speechListUrl' /** C192/C219 — segmented search-mode button (mobile full width, desktop inline). */ const modeButtonClass = (active: boolean, tone: 'termo' | 'tema'): string => cn( 'min-h-11 rounded-md px-3 text-sm md:min-h-9', active ? cn( 'bg-white font-semibold shadow-sm ring-1 ring-border', tone === 'tema' ? 'text-primary' : 'text-foreground', ) : 'font-medium text-muted-foreground', ) /** * C219 — the "Termo exato | Por tema" selector shared by the two acervo * sources. The mechanics (mode semantics, degradation) belong to the URL * contract and the loader; this component only renders the choice and the * honest state of the theme bridge. */ export const CampaignSearchModeControl = ({ activeMode, themeUnavailable = false, onSelect, relatedHint, unavailableHint = 'Indisponível agora; mostramos o termo exato.', }: { activeMode: SpeechSearchMode /** The theme expansion is down; the selector reflects the fallback. */ themeUnavailable?: boolean onSelect: (mode: SpeechSearchMode) => void /** Desktop hint of the corpus ("Encontra falas relacionadas pelo sentido."). */ relatedHint: string /** * C229 — the degraded helper. The speech sources use the approved copy of the * fallback scene, which stays visible on mobile too (the success hint does * not); the recordings keep their own line. */ unavailableHint?: string }) => (
{themeUnavailable ? unavailableHint : relatedHint}