diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-11-03 10:51:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-03 10:51:47 +0100 |
| commit | 60f8d79d9e8ccedcd95610a88dd7dc8ec5521aca (patch) | |
| tree | 4fa59e85859ea94a579970fb38ecd32232e2425c /src/frontend/app/components/GroupedTable.tsx | |
| parent | 73b975b7cff87d1e90ad4d0abadc1f65d62ae2e6 (diff) | |
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>
Diffstat (limited to 'src/frontend/app/components/GroupedTable.tsx')
| -rw-r--r-- | src/frontend/app/components/GroupedTable.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
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}> |
