Files
time_to_leave/src/lib/live-status-utils.ts
T
fegger 3b87b8c4e5 Implement real API clients and update types
Replace mock data in geocoding, HAFAS, and bike routing clients with
actual implementations using fetch and appropriate interfaces. Update
typescript definitions to match the new data structures, including
Journey, Station, and BikeRoute. Add vitest and related testing
dependencies, replacing the placeholder test script with actual tests
for the new client logic. Refactor calendar and countdown utilities to
use the new types and remove unused files.

Implement real API clients and update types

Replace mock data in HafasClient, GeocodingClient, and
BikeRoutingClient with actual fetch implementations. Update
types to match API responses and add Vitest tests.
2026-05-09 11:55:20 +02:00

24 lines
597 B
TypeScript

// Live status utilities for ÖBB Planner
import type { LiveStatus } from "@/types";
export class LiveStatusUtils {
static async getLiveStatus(_journeyId: string): Promise<LiveStatus> {
// This would make an actual API call to get live status
// For now, we'll return mock data
return null;
}
static getStatusMessage(status: LiveStatus): string {
switch (status) {
case true:
return "On time";
case false:
return "Delayed or cancelled";
case null:
return "No live data";
default:
return "Unknown status";
}
}
}