feat: ETA côtier — transformer la map en outil de décision actionnable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,15 @@ const TREND_CONFIG = {
|
||||
decreasing: { icon: '📉', label: 'Amélioration en cours', cls: 'trend--good' },
|
||||
};
|
||||
|
||||
function etaLabel(etaHours) {
|
||||
if (etaHours === 0) return { icon: '🚨', label: 'Impact en cours', cls: 'eta--now' };
|
||||
if (etaHours === 6) return { icon: '⚠️', label: 'Impact prévu dans ~6h', cls: 'eta--soon' };
|
||||
if (etaHours === 12) return { icon: '⚠️', label: 'Impact prévu dans ~12h', cls: 'eta--soon' };
|
||||
if (etaHours === 24) return { icon: '🕐', label: 'Impact prévu dans ~24h', cls: 'eta--later' };
|
||||
if (etaHours === 48) return { icon: '🕐', label: 'Impact prévu dans ~48h', cls: 'eta--later' };
|
||||
return { icon: '✅', label: 'Aucun impact prévu (48h)', cls: 'eta--safe' };
|
||||
}
|
||||
|
||||
const HORIZON_LABELS = { now: 'Maintenant', h6: '+6h', h12: '+12h', h24: '+24h', h48: '+48h' };
|
||||
|
||||
export default function SpotPanel({ spot, activeStep, onClose }) {
|
||||
@@ -72,6 +81,16 @@ export default function SpotPanel({ spot, activeStep, onClose }) {
|
||||
? <p className="spot-panel__no-data">Aucune donnée pour cet horizon.</p>
|
||||
: (
|
||||
<>
|
||||
{activeStep === 'now' && (() => {
|
||||
const eta = etaLabel(displayScore.etaHours ?? undefined);
|
||||
return (
|
||||
<div className={`spot-panel__eta ${eta.cls}`}>
|
||||
<span className="spot-panel__eta-icon">{eta.icon}</span>
|
||||
<span className="spot-panel__eta-label">{eta.label}</span>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
|
||||
<div className={`spot-panel__gauge gauge--${lvl}`}>
|
||||
<div className="spot-panel__gauge-top">
|
||||
<span className="spot-panel__gauge-label">{LEVEL_LABEL[lvl] ?? lvl}</span>
|
||||
|
||||
Reference in New Issue
Block a user