From 9618229477439d1604869aa68fc21d4eae7d8bb1 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Sun, 28 Dec 2025 22:40:52 +0100
Subject: feat: Enhance route details to include agency information and update
 map attribution

---
 src/frontend/app/routes/routes-$id.tsx | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'src/frontend/app/routes/routes-$id.tsx')

diff --git a/src/frontend/app/routes/routes-$id.tsx b/src/frontend/app/routes/routes-$id.tsx
index 8dd7e1c..3b61ba6 100644
--- a/src/frontend/app/routes/routes-$id.tsx
+++ b/src/frontend/app/routes/routes-$id.tsx
@@ -1,7 +1,12 @@
 import { useQuery } from "@tanstack/react-query";
 import { useRef, useState } from "react";
 import { useTranslation } from "react-i18next";
-import { Layer, Source, type MapRef } from "react-map-gl/maplibre";
+import {
+  AttributionControl,
+  Layer,
+  Source,
+  type MapRef,
+} from "react-map-gl/maplibre";
 import { useParams } from "react-router";
 import { fetchRouteDetails } from "~/api/transit";
 import { AppMap } from "~/components/shared/AppMap";
@@ -137,7 +142,9 @@ export default function RouteDetailsPage() {
             >
               {patterns.map((pattern) => (
                 <option key={pattern.id} value={pattern.id}>
-                  {pattern.code ? `${pattern.code.slice(-2)}: ` : ""}
+                  {pattern.code
+                    ? `${parseInt(pattern.code.slice(-2)).toString()}: `
+                    : ""}
                   {pattern.headsign || pattern.name}{" "}
                   {t("routes.trip_count_short", { count: pattern.tripCount })}
                 </option>
@@ -169,7 +176,14 @@ export default function RouteDetailsPage() {
                   handleStopClick(id, lat, lon, true);
                 }
               }}
+              showTraffic={false}
+              attributionControl={false}
             >
+              <AttributionControl
+                position="bottom-right"
+                compact={false}
+                customAttribution={route.agencyName || undefined}
+              />
               {selectedPattern?.geometry && (
                 <Source type="geojson" data={geojson}>
                   <Layer
-- 
cgit v1.3

