aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/RegularTable.tsx
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-11-03 10:51:47 +0100
committerGitHub <noreply@github.com>2025-11-03 10:51:47 +0100
commit60f8d79d9e8ccedcd95610a88dd7dc8ec5521aca (patch)
tree4fa59e85859ea94a579970fb38ecd32232e2425c /src/frontend/app/components/RegularTable.tsx
parent73b975b7cff87d1e90ad4d0abadc1f65d62ae2e6 (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/RegularTable.tsx')
-rw-r--r--src/frontend/app/components/RegularTable.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/frontend/app/components/RegularTable.tsx b/src/frontend/app/components/RegularTable.tsx
index 68b732a..868332f 100644
--- a/src/frontend/app/components/RegularTable.tsx
+++ b/src/frontend/app/components/RegularTable.tsx
@@ -1,10 +1,10 @@
import { useTranslation } from "react-i18next";
-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 RegularTableProps {
- data: StopDetails;
+ data: Estimate[];
dataDate: Date | null;
regionConfig: RegionConfig;
}
@@ -56,7 +56,7 @@ export const RegularTable: React.FC<RegularTableProps> = ({
</thead>
<tbody>
- {data.estimates
+ {data
.sort((a, b) => a.minutes - b.minutes)
.map((estimate, idx) => (
<tr key={idx}>
@@ -80,7 +80,7 @@ export const RegularTable: React.FC<RegularTableProps> = ({
))}
</tbody>
- {data?.estimates.length === 0 && (
+ {data?.length === 0 && (
<tfoot>
<tr>
<td colSpan={regionConfig.showMeters ? 4 : 3}>