import type { AMSUnit, AMSTray } from '../../api/client'; import { getFillBarColor } from '../../utils/amsHelpers'; function trayColorToCSS(color: string | null): string { if (!color) return '#808080'; return `#${color.slice(0, 6)}`; } function isTrayEmpty(tray: AMSTray): boolean { return !tray.tray_type || tray.tray_type === ''; } function getAmsName(id: number): string { if (id <= 3) return `AMS ${String.fromCharCode(65 + id)}`; if (id >= 128 && id <= 135) return `AMS HT ${String.fromCharCode(65 + id - 128)}`; return `AMS ${id}`; } // --- SVG Icons (matching PrintersPage Bambu Lab style) --- function WaterDropEmpty({ className }: { className?: string }) { return ( ); } function WaterDropHalf({ className }: { className?: string }) { return ( ); } function WaterDropFull({ className }: { className?: string }) { return ( ); } function ThermometerEmpty({ className }: { className?: string }) { return ( ); } function ThermometerHalf({ className }: { className?: string }) { return ( ); } function ThermometerFull({ className }: { className?: string }) { return ( ); } // --- Threshold-colored indicators --- function HumidityIndicator({ humidity, goodThreshold = 40, fairThreshold = 60 }: { humidity: number; goodThreshold?: number; fairThreshold?: number }) { let textColor: string; let DropComponent: React.FC<{ className?: string }>; if (humidity <= goodThreshold) { textColor = '#22a352'; DropComponent = WaterDropEmpty; } else if (humidity <= fairThreshold) { textColor = '#d4a017'; DropComponent = WaterDropHalf; } else { textColor = '#c62828'; DropComponent = WaterDropFull; } return (