From 60f8d79d9e8ccedcd95610a88dd7dc8ec5521aca Mon Sep 17 00:00:00 2001
From: Copilot <198982749+Copilot@users.noreply.github.com>
Date: Mon, 3 Nov 2025 10:51:47 +0100
Subject: Simplify estimates endpoint to return only arrival data (#57)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
---
 src/frontend/app/components/GroupedTable.tsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

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

diff --git a/src/frontend/app/components/GroupedTable.tsx b/src/frontend/app/components/GroupedTable.tsx
index fd97d5b..9bdd5a0 100644
--- a/src/frontend/app/components/GroupedTable.tsx
+++ b/src/frontend/app/components/GroupedTable.tsx
@@ -1,9 +1,9 @@
-import { type StopDetails } from "../routes/estimates-$id";
+import { type Estimate } from "../routes/estimates-$id";
 import LineIcon from "./LineIcon";
 import { type RegionConfig } from "../data/RegionConfig";
 
 interface GroupedTable {
-  data: StopDetails;
+  data: Estimate[];
   dataDate: Date | null;
   regionConfig: RegionConfig;
 }
@@ -17,7 +17,7 @@ export const GroupedTable: React.FC<GroupedTable> = ({ data, dataDate, regionCon
     }
   };
 
-  const groupedEstimates = data.estimates.reduce(
+  const groupedEstimates = data.reduce(
     (acc, estimate) => {
       if (!acc[estimate.line]) {
         acc[estimate.line] = [];
@@ -25,7 +25,7 @@ export const GroupedTable: React.FC<GroupedTable> = ({ data, dataDate, regionCon
       acc[estimate.line].push(estimate);
       return acc;
     },
-    {} as Record<string, typeof data.estimates>,
+    {} as Record<string, typeof data>,
   );
 
   const sortedLines = Object.keys(groupedEstimates).sort((a, b) => {
@@ -72,7 +72,7 @@ export const GroupedTable: React.FC<GroupedTable> = ({ data, dataDate, regionCon
         )}
       </tbody>
 
-      {data?.estimates.length === 0 && (
+      {data?.length === 0 && (
         <tfoot>
           <tr>
             <td colSpan={regionConfig.showMeters ? 4 : 3}>
-- 
cgit v1.3

