interface WifiSignalProps { signal: number | null | undefined; // dBm value className?: string; } /** * WiFi signal icon with 4 bars that fill based on signal strength. * - 4 bars: >= -50 dBm (excellent) * - 3 bars: >= -60 dBm (good) * - 2 bars: >= -70 dBm (fair) * - 1 bar: < -70 dBm (weak) * - 0 bars: no signal data */ export function WifiSignal({ signal, className = "w-4 h-4" }: WifiSignalProps) { let bars = 0; if (signal != null) { if (signal >= -50) bars = 4; else if (signal >= -60) bars = 3; else if (signal >= -70) bars = 2; else bars = 1; } const activeColor = "#00ae42"; // bambu-green const inactiveColor = "#4a4a4a"; // dark gray return ( {/* Dot at bottom */} = 1 ? activeColor : inactiveColor} stroke={bars >= 1 ? activeColor : inactiveColor} /> {/* First arc (smallest) */} = 2 ? activeColor : inactiveColor} fill="none" /> {/* Second arc */} = 3 ? activeColor : inactiveColor} fill="none" /> {/* Third arc (largest) */} = 4 ? activeColor : inactiveColor} fill="none" /> ); }