diff --git a/apps/web/src/components/StatusBar.tsx b/apps/web/src/components/StatusBar.tsx index b4563fe..53b839f 100644 --- a/apps/web/src/components/StatusBar.tsx +++ b/apps/web/src/components/StatusBar.tsx @@ -18,6 +18,13 @@ type StatusBarProps = { } | null; }; +type StatusItemData = { + icon?: ReactNode; + label: string; + value: string; + speed?: boolean; +}; + export function StatusBar({ gps, forecast, @@ -39,7 +46,7 @@ export function StatusBar({ ? "Position aktiv" : `±${gps.accuracyM} m` : gpsStatusLabel(gps.status); - const speedValue = gps.speedKn === null ? "-- kn" : `${gps.speedKn.toFixed(1)} kn`; + const speedValue = formatGpsSpeed(gps.speedKn); const tideValue = tide?.nextHigh ? `HW ${new Date(tide.nextHigh.time).toLocaleTimeString("de-DE", { hour: "2-digit", @@ -48,7 +55,7 @@ export function StatusBar({ : "Keine Daten"; const conditionsValue = formatConditions(forecast); - const items = + const items: StatusItemData[] = resolvedMode === "anchor" ? [ { @@ -95,9 +102,9 @@ export function StatusBar({ value: `${routeWarningCount} offen` } : { - icon: