aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/routes/estimates-$id.tsx
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-11-06 15:44:58 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-11-06 15:44:58 +0100
commit093ee906eae5361bbf47ae2fdc4003f95696656a (patch)
tree055c656f69e91d6f503a4e11b9808e825e012feb /src/frontend/app/routes/estimates-$id.tsx
parentd95cfa74c5fcb9e58af1f85f8d76d859f155fce3 (diff)
Rename schedules table
Diffstat (limited to 'src/frontend/app/routes/estimates-$id.tsx')
-rw-r--r--src/frontend/app/routes/estimates-$id.tsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/frontend/app/routes/estimates-$id.tsx b/src/frontend/app/routes/estimates-$id.tsx
index 60d533a..f213105 100644
--- a/src/frontend/app/routes/estimates-$id.tsx
+++ b/src/frontend/app/routes/estimates-$id.tsx
@@ -7,13 +7,13 @@ import { RegularTable } from "../components/RegularTable";
import { useApp } from "../AppContext";
import { GroupedTable } from "../components/GroupedTable";
import { useTranslation } from "react-i18next";
-import { TimetableTable, type TimetableEntry } from "../components/TimetableTable";
-import { EstimatesTableSkeleton, EstimatesGroupedSkeleton } from "../components/EstimatesTableSkeleton";
-import { TimetableSkeleton } from "../components/TimetableSkeleton";
-import { ErrorDisplay } from "../components/ErrorDisplay";
-import { PullToRefresh } from "../components/PullToRefresh";
-import { useAutoRefresh } from "../hooks/useAutoRefresh";
-import { type RegionId, getRegionConfig } from "../data/RegionConfig";
+import { SchedulesTable, type ScheduledTable } from "~/components/SchedulesTable";
+import { SchedulesTableSkeleton, EstimatesGroupedSkeleton } from "~/components/SchedulesTableSkeleton";
+import { TimetableSkeleton } from "~/components/TimetableSkeleton";
+import { ErrorDisplay } from "~/components/ErrorDisplay";
+import { PullToRefresh } from "~/components/PullToRefresh";
+import { useAutoRefresh } from "~/hooks/useAutoRefresh";
+import { type RegionId, getRegionConfig } from "~/data/RegionConfig";
export interface Estimate {
line: string;
@@ -43,7 +43,7 @@ const loadData = async (region: RegionId, stopId: string): Promise<Estimate[]> =
return await resp.json();
};
-const loadTimetableData = async (region: RegionId, stopId: string): Promise<TimetableEntry[]> => {
+const loadTimetableData = async (region: RegionId, stopId: string): Promise<ScheduledTable[]> => {
const regionConfig = getRegionConfig(region);
// Check if timetable is available for this region
@@ -79,7 +79,7 @@ export default function Estimates() {
const [estimatesError, setEstimatesError] = useState<ErrorInfo | null>(null);
// Timetable data state
- const [timetableData, setTimetableData] = useState<TimetableEntry[]>([]);
+ const [timetableData, setTimetableData] = useState<ScheduledTable[]>([]);
const [timetableLoading, setTimetableLoading] = useState(true);
const [timetableError, setTimetableError] = useState<ErrorInfo | null>(null);
@@ -114,7 +114,7 @@ export default function Estimates() {
const body = await loadData(region, params.id!);
setData(body);
setDataDate(new Date());
-
+
// Load stop data from StopDataProvider
const stop = await StopDataProvider.getStopById(region, stopIdNum);
setStopData(stop);
@@ -237,7 +237,7 @@ export default function Estimates() {
{tableStyle === "grouped" ? (
<EstimatesGroupedSkeleton />
) : (
- <EstimatesTableSkeleton />
+ <SchedulesTableSkeleton />
)}
</div>
@@ -281,7 +281,7 @@ export default function Estimates() {
tableStyle === "grouped" ? (
<EstimatesGroupedSkeleton />
) : (
- <EstimatesTableSkeleton />
+ <SchedulesTableSkeleton />
)
) : estimatesError ? (
<ErrorDisplay
@@ -310,7 +310,7 @@ export default function Estimates() {
/>
) : timetableData.length > 0 ? (
<>
- <TimetableTable
+ <SchedulesTable
data={timetableData}
currentTime={new Date().toTimeString().slice(0, 8)} // HH:MM:SS
/>