import { cn } from '@/lib/utils'; // MeterBar is the ONE LED-bar meter used across the FlexRadio panel, the amplifier // cards and the Tuner Genius card, so every meter renders at exactly the same size // (segment count, bar height, padding). Keep it the single source of truth — don't // re-declare a local copy in a panel, or the meters drift out of sync. export const METER_SEGMENTS = 26; export function MeterBar({ label, value, unit, lo, hi, accent = '#16a34a', extra, display, segColor, onClick, title, compact }: { label: string; value: number; unit?: string; lo: number; hi: number; accent?: string; extra?: string; display?: string; segColor?: (frac: number) => string; onClick?: () => void; title?: string; compact?: boolean; }) { const span = hi - lo; const pct = span > 0 ? Math.max(0, Math.min(100, ((value - lo) / span) * 100)) : 0; const lit = Math.round((pct / 100) * METER_SEGMENTS); return (