From 4a866f5352a51916ddb9849b2d68213856196c9c Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Tue, 23 Dec 2025 21:33:17 +0100
Subject: Full real-time page, coruña real time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../app/components/arrivals/ArrivalList.tsx        | 29 ++++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)

(limited to 'src/frontend/app/components/arrivals/ArrivalList.tsx')

diff --git a/src/frontend/app/components/arrivals/ArrivalList.tsx b/src/frontend/app/components/arrivals/ArrivalList.tsx
index b2394fb..0186682 100644
--- a/src/frontend/app/components/arrivals/ArrivalList.tsx
+++ b/src/frontend/app/components/arrivals/ArrivalList.tsx
@@ -1,25 +1,38 @@
 import React from "react";
 import { type Arrival } from "../../api/schema";
-import { ReducedArrivalCard } from "./ArrivalCard";
+import { ArrivalCard } from "./ArrivalCard";
+import { ReducedArrivalCard } from "./ReducedArrivalCard";
 
 interface ArrivalListProps {
   arrivals: Arrival[];
   reduced?: boolean;
+  onArrivalClick?: (arrival: Arrival) => void;
 }
 
 export const ArrivalList: React.FC<ArrivalListProps> = ({
   arrivals,
   reduced,
+  onArrivalClick,
 }) => {
+  const clickable = Boolean(onArrivalClick);
+
   return (
     <div className="flex flex-col gap-3">
-      {arrivals.map((arrival, index) => (
-        <ReducedArrivalCard
-          key={`${arrival.route.shortName}-${index}`}
-          arrival={arrival}
-          reduced={reduced}
-        />
-      ))}
+      {arrivals.map((arrival, index) =>
+        reduced ? (
+          <ReducedArrivalCard
+            key={`${arrival.tripId}-${index}`}
+            arrival={arrival}
+            onClick={clickable ? () => onArrivalClick?.(arrival) : undefined}
+          />
+        ) : (
+          <ArrivalCard
+            key={`${arrival.tripId}-${index}`}
+            arrival={arrival}
+            onClick={clickable ? () => onArrivalClick?.(arrival) : undefined}
+          />
+        )
+      )}
     </div>
   );
 };
-- 
cgit v1.3

