import { useAtom } from "jotai"; import { connectionStatusAtom, type ConnectionStatus as ConnectionStatusType } from "../atoms"; import { Wifi, WifiOff } from "lucide-react"; import { motion, AnimatePresence } from "motion/react"; const statusConfig: Record = { connecting: { color: "text-yellow-400", icon: , label: "Connecting..." }, connected: { color: "text-green-400", icon: , label: "Connected" }, disconnected: { color: "text-red-400", icon: , label: "Disconnected" }, reconnecting: { color: "text-yellow-400", icon: , label: "Reconnecting..." }, }; export const ConnectionStatus = () => { const [status] = useAtom(connectionStatusAtom); const config = statusConfig[status]; // Only show when not connected const shouldShow = status !== 'connected'; return ( {shouldShow && ( {config.icon} {config.label} )} ); };