From 2e84f4eae4b8e4510822335f38ad2615cd64594f Mon Sep 17 00:00:00 2001 From: BuTzZ Date: Tue, 28 Jul 2026 16:39:35 +0200 Subject: [PATCH] GPS Geschwindigkeitsanzeige --- apps/web/src/components/StatusBar.tsx | 80 ++++++++++++++++++-------- apps/web/src/styles/app.css | 9 ++- apps/web/tests/status-bar.test.tsx | 7 ++- packages/shared/src/fairway-routing.ts | 15 +---- packages/shared/tests/route.test.ts | 4 +- 5 files changed, 70 insertions(+), 45 deletions(-) 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: