Added reading and using of spool orders in locations

This commit is contained in:
Donkie
2024-11-20 21:57:01 +01:00
parent ce42d687ed
commit bf06408368
5 changed files with 85 additions and 26 deletions

View File

@@ -21,6 +21,8 @@ export function Location({
onDelete,
moveLocation,
onEditTitle,
locationSpoolOrder,
setLocationSpoolOrder,
}: {
index: number;
title: string;
@@ -29,6 +31,8 @@ export function Location({
onDelete?: () => void;
moveLocation: (dragIndex: number, hoverIndex: number) => void;
onEditTitle: (newTitle: string) => void;
locationSpoolOrder: number[];
setLocationSpoolOrder: (spoolOrder: number[]) => void;
}) {
const [editTitle, setEditTitle] = useState(false);
const [newTitle, setNewTitle] = useState(title);
@@ -123,7 +127,12 @@ export function Location({
)}
{showDelete && <Button icon={<DeleteOutlined />} size="small" type="text" onClick={onDelete} />}
</h3>
<SpoolList location={title} spools={spools} />
<SpoolList
location={title}
spools={spools}
spoolOrder={locationSpoolOrder}
setSpoolOrder={setLocationSpoolOrder}
/>
</div>
);
}