From 769d12a525875d3577b2868208d6315c56ce77d6 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Mon, 3 Nov 2025 11:20:27 +0100
Subject: Display available lines on StopSheet

---
 src/frontend/app/routes/map.tsx | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

(limited to 'src/frontend/app/routes/map.tsx')

diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx
index 29b097d..effd29b 100644
--- a/src/frontend/app/routes/map.tsx
+++ b/src/frontend/app/routes/map.tsx
@@ -1,4 +1,4 @@
-import StopDataProvider from "../data/StopDataProvider";
+import StopDataProvider, { type Stop } from "../data/StopDataProvider";
 import "./map.css";
 
 import { useEffect, useRef, useState } from "react";
@@ -34,10 +34,7 @@ export default function StopMap() {
   const [stops, setStops] = useState<
     GeoJsonFeature<Point, { stopId: number; name: string; lines: string[] }>[]
   >([]);
-  const [selectedStop, setSelectedStop] = useState<{
-    stopId: number;
-    name: string;
-  } | null>(null);
+  const [selectedStop, setSelectedStop] = useState<Stop | null>(null);
   const [isSheetOpen, setIsSheetOpen] = useState(false);
   const { mapState, updateMapState, theme, region } = useApp();
   const mapRef = useRef<MapRef>(null);
@@ -118,10 +115,7 @@ export default function StopMap() {
     // fetch full stop to get lines array
     StopDataProvider.getStopById(region, props.stopId).then((stop) => {
       if (!stop) return;
-      setSelectedStop({
-        stopId: stop.stopId,
-        name: stop.name.original,
-      });
+      setSelectedStop(stop);
       setIsSheetOpen(true);
     });
   };
@@ -190,13 +184,11 @@ export default function StopMap() {
         }}
       />
 
-
       {selectedStop && (
         <StopSheet
           isOpen={isSheetOpen}
           onClose={() => setIsSheetOpen(false)}
-          stopId={selectedStop.stopId}
-          stopName={selectedStop.name}
+          stop={selectedStop}
         />
       )}
     </Map>
-- 
cgit v1.3

