diff --git a/apps/web/src/components/infoscreen/hsl-schedule/index.tsx b/apps/web/src/components/infoscreen/hsl-schedule/index.tsx index ba4c4bd9..9633bf6b 100644 --- a/apps/web/src/components/infoscreen/hsl-schedule/index.tsx +++ b/apps/web/src/components/infoscreen/hsl-schedule/index.tsx @@ -1,72 +1,55 @@ -import type { - ArrivalAttribute, - RenderableStop, - StopType, -} from "../types/hsl-helper-types.ts"; +import type { Stop, StopType } from "../types/hsl-helper-types.ts"; -export function HSLSchedule(props: { - result: RenderableStop; - className: string; -}) { - const result = props.result; - - const colorMetro = "#ca4000"; - const colorTram = "#007e79"; - const colorBus = "#007ac9"; - const colorNull = "gray-900"; - - const getColor = (): string => { - if (result.type === "metro") { - return colorMetro; - } else if (result.type === "tram") { - return colorTram; - } else if (result.type === "bus") { - return colorBus; - } - return colorNull; - }; - - const className = `shadow-solid shadow-[var(--infonayttoHSLcolor)] text-l flex flex-col justify-between rounded-md border-2 border-[var(--infonayttoHSLcolor)] p-3 font-mono text-gray-900 md:flex-row md:items-center`; +const getColor = (type: StopType): string => { + switch (type) { + case "metro": + return "#ca4000"; + case "tram": + return "#007e79"; + case "bus": + return "#007ac9"; + } +}; - const stopName = (type: StopType) => { - if (type === "metro") { +const stopName = (type: StopType) => { + switch (type) { + case "metro": return "Metro"; - } else if (type === "tram") { + case "tram": return "Raide-Jokeri"; - } else if (type === "bus") { + case "bus": return "Bussit"; - } - return "Unknown"; - }; + } +}; +interface HSLScheduleProps { + stop: Stop; + className: string; +} + +export function HSLSchedule({ stop }: HSLScheduleProps) { return (