diff --git a/assets/src/models/shuttle.ts b/assets/src/models/shuttle.ts index a8f0fa00a..bc7744576 100644 --- a/assets/src/models/shuttle.ts +++ b/assets/src/models/shuttle.ts @@ -1,4 +1,4 @@ -import { Vehicle } from "../realtime" +import { RunId, Vehicle } from "../realtime" export enum ShuttleVariant { // Rapid Transit Lines @@ -12,6 +12,27 @@ export enum ShuttleVariant { Special, } +export const shuttleVariantFromRunId = ( + runId: RunId +): ShuttleVariant | null => { + switch (runId) { + case "999-0501": + return ShuttleVariant.Blue + case "999-0502": + return ShuttleVariant.Green + case "999-0503": + return ShuttleVariant.Orange + case "999-0504": + return ShuttleVariant.Red + case "999-0505": + return ShuttleVariant.CommuterRail + case "999-0555": + return ShuttleVariant.Special + default: + return null + } +} + export const formattedRunNumber = ({ runId }: Vehicle): string => { if (runId === null) { return "Not Available"