interface EnvironmentGaugeProps { label: string; value: number; unit: string; target: number; min: number; max: number; compact?: boolean; } export default function EnvironmentGauge({ label, value, unit, target, min, max, compact = false, }: EnvironmentGaugeProps) { const isLow = value < min; const isHigh = value > max; const isOptimal = value >= min && value <= max; const statusColor = isOptimal ? 'text-green-600' : isLow || isHigh ? 'text-red-600' : 'text-yellow-600'; const bgColor = isOptimal ? 'bg-green-100' : isLow || isHigh ? 'bg-red-100' : 'bg-yellow-100'; if (compact) { return (
{label}
{typeof value === 'number' ? value.toFixed(0) : value} {unit && {unit}}
{deviation > 0 ? '+' : ''}{deviation.toFixed(1)}{unit} from target
)}