import { useState } from 'react'; import type { WeatherSnapshot } from '../../entities/weather/model/types'; import { getWindDirectionLabel, getWindArrow, getWaveSeverity, getWeatherLabel, } from '../../entities/weather/lib/weatherUtils'; interface WeatherPanelProps { snapshot: WeatherSnapshot | null; isLoading: boolean; error: string | null; onRefresh: () => void; } function fmtTime(ts: number): string { const d = new Date(ts); return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`; } function fmtVal(v: number | null, unit: string, decimals = 1): string { if (v == null) return '-'; return `${v.toFixed(decimals)}${unit}`; } export function WeatherPanel({ snapshot, isLoading, error, onRefresh }: WeatherPanelProps) { const [open, setOpen] = useState(false); return ( <> {open && (