From 91f7d7dd5a4ca8453cfdbc9a3beeb216b6638ef7 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Mon, 22 Dec 2025 14:13:45 +0100
Subject: Implement fetching scheduled arrivals for stop

---
 src/frontend/app/routes/map.tsx | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 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 db9de59..279f096 100644
--- a/src/frontend/app/routes/map.tsx
+++ b/src/frontend/app/routes/map.tsx
@@ -122,7 +122,12 @@ export default function StopMap() {
     Array.isArray(center) ? center[1] : center.lng;
 
   const handlePointClick = (feature: any) => {
-    const props: any = feature.properties;
+    const props: {
+      id: string;
+      code: string;
+      name: string;
+      routes: string;
+    } = feature.properties;
     // TODO: Move ID to constant, improve type checking
     if (!props || feature.layer.id !== "stops") {
       console.warn("Invalid feature properties:", props);
@@ -130,14 +135,18 @@ export default function StopMap() {
     }
 
     const stopId = props.id;
-
-    console.debug("Stop clicked:", stopId, props);
+    const routes: {
+      shortName: string;
+      colour: string;
+      textColour: string;
+    }[] = JSON.parse(props.routes || "[]");
 
     setSelectedStop({
       stopId: props.id,
       stopCode: props.code,
       name: props.name || "Unknown Stop",
-      lines: JSON.parse(props.routes || "[]").map((route) => {
+      lines: routes.map((route) => {
+        console.log(route);
         return {
           line: route.shortName,
           colour: route.colour,
-- 
cgit v1.3

