changes export flow

This commit is contained in:
Marshal
2026-07-30 11:30:34 +00:00
parent b671f07ce6
commit 2ca04b8f98
47 changed files with 1195 additions and 74 deletions

View File

@@ -86,6 +86,13 @@ export default function BuildTrainModal({ opened, onClose, onBuilt }: BuildTrain
}, [opened]);
const handleBuild = async () => {
if (!trainName.trim()) {
toast({
title: "Enter the vogue number",
variant: "destructive",
});
return;
}
if (!yardId || locomotiveIds.length < 1) {
toast({
title: "Pick a yard and couple at least one locomotive",
@@ -108,7 +115,7 @@ export default function BuildTrainModal({ opened, onClose, onBuilt }: BuildTrain
importTrainNumber: importTrainNumber.trim(),
currentYardId: yardId,
locomotiveIds,
...(trainName.trim() ? { trainName: trainName.trim() } : {}),
trainName: trainName.trim(),
...(notes.trim() ? { notes: notes.trim() } : {}),
});
toast({ title: `Train ${composition.code} built` });
@@ -143,11 +150,12 @@ export default function BuildTrainModal({ opened, onClose, onBuilt }: BuildTrain
wagons are attached on the next screen.
</Text>
<TextInput
label="Name (optional)"
placeholder="e.g. Fertilizer block"
label="Vogue number"
placeholder="Enter vogue number"
value={trainName}
onChange={(e) => setTrainName(e.currentTarget.value)}
maxLength={100}
required
/>
<Group grow>
{/* Fixed by the import run — derived, never typed. */}