import React from 'react'; import { Wifi, WifiOff, Radio } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip'; interface LiveDataIndicatorProps { status: 'connecting' | 'connected' | 'disconnected' | 'simulated'; className?: string; } export function LiveDataIndicator({ status, className }: LiveDataIndicatorProps) { const statusConfig = { connecting: { icon: Wifi, label: 'Connecting...', color: 'text-yellow-500', pulse: true, }, connected: { icon: Wifi, label: 'Live Data', color: 'text-green-500', pulse: true, }, disconnected: { icon: WifiOff, label: 'Disconnected', color: 'text-destructive', pulse: false, }, simulated: { icon: Radio, label: 'Simulated Data', color: 'text-primary', pulse: true, }, }; const config = statusConfig[status]; const Icon = config.icon; return (
{config.pulse && ( )}
{status === 'simulated' ? 'LIVE' : status.toUpperCase()}

{config.label}

); }