import { Box, Flex, Text, Tooltip, VStack, Circle } from '@chakra-ui/react' import { FiWifi, FiWifiOff } from 'react-icons/fi' import { useApp } from '../../stores/AppContext' const SERVICES = [ { key: 'database' as const, label: 'Database' }, { key: 'ssh' as const, label: 'SSH Tunnel' }, { key: 'bgd' as const, label: 'BG Director' }, { key: 'rmq' as const, label: 'RMQ' }, ] export default function ConnectionBadge() { const { state } = useApp() const statuses = SERVICES.map((s) => state.connectionStatus[s.key]) const upCount = statuses.filter(Boolean).length const allUp = upCount === statuses.length const allDown = upCount === 0 const dotColor = allUp ? 'success.DEFAULT' : allDown ? 'danger.DEFAULT' : 'warning.DEFAULT' return ( {allUp ? ( ) : ( )} Service Status {SERVICES.map((s) => ( {s.label} {state.connectionStatus[s.key] ? 'OK' : 'DOWN'} ))} ) }