import { useState } from "react"; import { PROMPTS, THEME } from "../constants"; interface LiveCaptionProps { caption: string; isRunning?: boolean; error?: string | null; history: HistoryEntry[]; stats?: { tps?: number; ttft?: number }; } export interface HistoryEntry { timestamp: string; text: string; } export default function LiveCaption({ caption, isRunning, error, history, stats, }: LiveCaptionProps) { const [showHistory, setShowHistory] = useState(false); const content = error || caption; const status = error ? { bg: "bg-[var(--mistral-red)]/10", border: "border-[var(--mistral-red)]", text: "text-[var(--mistral-red)]", dot: "bg-[var(--mistral-red)]", label: "SYSTEM ERROR", } : isRunning ? { bg: "bg-[var(--mistral-orange)]/5", border: "border-[var(--mistral-orange)]", text: "text-[var(--mistral-orange)]", dot: "bg-[var(--mistral-orange)]", label: "LIVE INFERENCE", } : { bg: "bg-gray-50", border: "border-[var(--mistral-beige-dark)]", text: "text-gray-500", dot: "bg-gray-400", label: "STANDBY", }; return ( <>
No history recorded yet.
{content} {/* Blinking Block Cursor */} {!error && isRunning && ( )}
) : ({PROMPTS.processingMessage}
> ) : (
// Awaiting visual input...
// Model ready.