'use client'; import { Loader2, Sparkles } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useEffect, useState } from 'react'; interface StreamingIndicatorProps { isStreaming: boolean; className?: string; } export function StreamingIndicator({ isStreaming, className }: StreamingIndicatorProps) { const [dots, setDots] = useState(''); useEffect(() => { if (!isStreaming) { setDots(''); return; } const interval = setInterval(() => { setDots(prev => { if (prev === '...') return ''; return prev + '.'; }); }, 500); return () => clearInterval(interval); }, [isStreaming]); if (!isStreaming) return null; return (
Streaming{dots}
); }