leg-aware capacity and wagon sharing

This commit is contained in:
Marshal
2026-07-30 17:21:44 +00:00
parent 8f25fb3e8b
commit acef6870e9
15 changed files with 653 additions and 119 deletions

View File

@@ -1108,6 +1108,10 @@ export interface ExportTrainOptionWagonType {
*/
export interface ExportTrainOption {
scheduleId: string;
/** Schedule's train number (falls back to the built train's number). */
trainNumber: string | null;
/** Built train's name/code, when the schedule runs a Train Builder train. */
trainName: string | null;
departure: string;
bookingClosesAt: string | null;
isOpen: boolean;

View File

@@ -89,7 +89,14 @@ export function ExportTrainPicker({
<TrainFront size={16} color={selected ? SELECTED : "#5B6B7A"} />
<Box>
<Text fz="13px" fw={600} c="#10202F">
Departs {departureLabel(option.departure)} EAT
{option.trainNumber
? `Train ${option.trainNumber}`
: (option.trainName ?? "Train")}
{option.trainNumber && option.trainName
? ` · ${option.trainName}`
: ""}
{" — departs "}
{departureLabel(option.departure)} EAT
</Text>
<Text fz="12px" c="dimmed">
{option.freeWagons} wagon{option.freeWagons === 1 ? "" : "s"} free