mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 21:15:41 +00:00
- WarehouseLoading entity + Batch3 migration (wagon loading records) - wagon-aware load() with validation; dispatch moved to PATCH - read-only SchedulingReadFacade (schedule/wagon/departure) — never writes scheduling - new endpoints: GET /warehouse-loadings, loadable-wagons, booking schedule - Loading Queue / Loaded Inventory / Dispatch Queue pages + routes + sidebar - FreightVisual illustrations (page heroes + empty states) - booking detail: loaded/dispatched/wagon + read-only train schedule Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35 lines
921 B
TypeScript
35 lines
921 B
TypeScript
import { Select } from '@mantine/core';
|
|
|
|
import { useLoadableWagons } from '@/hooks/useWarehouses';
|
|
|
|
interface WagonSelectProps {
|
|
value: string;
|
|
onChange: (wagonId: string) => void;
|
|
label?: string;
|
|
required?: boolean;
|
|
}
|
|
|
|
/** Searchable wagon picker. Lists wagons that are loadable (read-only from scheduling). */
|
|
export function WagonSelect({ value, onChange, label = 'Wagon', required }: WagonSelectProps) {
|
|
const { data, isLoading } = useLoadableWagons();
|
|
|
|
const options = (data ?? []).map((w) => ({
|
|
value: w.id,
|
|
label: `${w.wagonNumber} · ${w.status}`,
|
|
}));
|
|
|
|
return (
|
|
<Select
|
|
label={label}
|
|
required={required}
|
|
searchable
|
|
clearable
|
|
data={options}
|
|
value={value || null}
|
|
onChange={(v) => onChange(v ?? '')}
|
|
placeholder={isLoading ? 'Loading wagons…' : 'Search wagon number'}
|
|
nothingFoundMessage="No loadable wagons found"
|
|
/>
|
|
);
|
|
}
|