import { useChatStatus, type DerivedStatus } from '@/hooks/useChatStatus'; import { cn } from '@/lib/utils'; interface Props { chatId: string | null | undefined; className?: string; } const STATUS_LABEL: Record = { streaming: 'streaming', tool_running: 'running tool', waiting_for_input: 'waiting for input', idle_warm: 'idle', idle_cold: 'idle', error: 'error', }; export function StatusDot({ chatId, className }: Props) { const status = useChatStatus(chatId); if (status === 'streaming') { return ( ); } if (status === 'tool_running') { return ( ); } if (status === 'waiting_for_input') { return ( ); } const bg = status === 'idle_warm' ? 'bg-emerald-500' : status === 'error' ? 'bg-destructive' : 'bg-muted-foreground/40'; return ( ); }