import { useState, useEffect, useRef } from 'react'; import { Bot } from 'lucide-react'; import { useT } from '../hooks/useLocale'; function formatElapsed(seconds: number): string { if (seconds < 60) return `${seconds}s`; const m = Math.floor(seconds / 60); const s = seconds % 60; return `${m}m ${s.toString().padStart(2, '0')}s`; } export function TypingIndicator() { const t = useT(); const [elapsed, setElapsed] = useState(0); const startRef = useRef(0); useEffect(() => { startRef.current = Date.now(); const interval = setInterval(() => { setElapsed(Math.floor((Date.now() - startRef.current) / 1000)); }, 1000); return () => clearInterval(interval); }, []); return (