import { Badge, Button, Group, Paper, Stack, Tabs, Text, } from "@mantine/core"; import { ArrowRight, FileText, Landmark, MapPin, Package, Train } from "lucide-react"; import type { EligibleContainerBooking, FreightType } from "@/types/trainScheduling"; import { EligibleBookingsPanel } from "./EligibleBookingsPanel"; export type AssignedBookingRow = { id: string; reference: string; weightTons?: number; isGovernment?: boolean; wagonsRequired?: number | null; contractReference?: string | null; origin?: string | null; destination?: string | null; }; export function ScheduleBookingsStep({ assignedBookings, eligibleItems, eligibleLoading, selectedIds, onSelectionChange, assignedIds, freightType, canRemove, onRemove, onSwitch, }: { assignedBookings: AssignedBookingRow[]; eligibleItems: EligibleContainerBooking[]; eligibleLoading?: boolean; selectedIds: string[]; onSelectionChange: (ids: string[]) => void; assignedIds?: string[]; freightType?: FreightType; canRemove?: boolean; onRemove?: (bookingId: string) => void; onSwitch?: (booking: EligibleContainerBooking) => void; }) { return ( } rightSection={ assignedBookings.length ? ( {assignedBookings.length} ) : undefined } > On this train }> Add bookings {assignedBookings.length ? ( {assignedBookings.map((booking) => ( {booking.reference} {booking.weightTons != null ? ( {booking.weightTons}T ) : null} {booking.wagonsRequired != null ? ( } > {booking.wagonsRequired} wagon{booking.wagonsRequired === 1 ? "" : "s"} ) : null} {booking.isGovernment ? ( } > Government ) : null} {booking.contractReference || booking.origin || booking.destination ? ( {booking.contractReference ? ( {booking.contractReference} ) : null} {booking.origin || booking.destination ? ( {booking.origin ?? "?"} → {booking.destination ?? "?"} ) : null} ) : null} Assigned to this consist Ready for wagon plan {canRemove && onRemove ? ( ) : null} ))} ) : ( No bookings on this train yet. Use the Add bookings tab to select eligible cargo. )} ); }