import { useRef, useState } from 'react'; import { Flame, ChevronDown } from 'lucide-react'; import { cn } from '@/lib/utils'; import { MeterBar } from '@/components/MeterBar'; import { AmpOperate, AmpPower, AmpPowerLevel, AmpFanMode, FlexAmpOperate } from '../../wailsjs/go/main/App'; // AmpCard renders the amplifier card exactly like the one in the FlexRadio panel, // so Station Control (and anywhere else that needs it) shows the SAME card instead // of a stripped-down variant. It handles all three amp families: // • SPE Expert / ACOM — driven by OpsLog's own serial/TCP link (amp.spe/amp.acom) // • PowerGenius XL — OPERATE + meters come from the Flex (which reports the // amp), fan mode from the direct GSCP link (amp.pgxl) // Controls use the multi-amp API (AmpOperate/AmpPower/… by amp id) so several amps // can each get their own card. function Card({ icon: Icon, title, accent, children, ckey }: { icon: any; title: string; accent?: string; children: React.ReactNode; ckey?: string }) { // Collapsible with persisted state — same behaviour as the FlexRadio panel's Card. const storeKey = 'opslog.cardOpen.' + (ckey || title); const [open, setOpen] = useState(() => localStorage.getItem(storeKey) !== '0'); const toggle = () => setOpen((o) => { const n = !o; localStorage.setItem(storeKey, n ? '1' : '0'); return n; }); return (