Implement resetStates hook and integrate it into Header component for state management

This commit is contained in:
2025-06-24 11:04:56 +05:30
parent b49f431ebf
commit a5afcd5757
5 changed files with 56 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ interface AisleStore {
updateAisle: (uuid: string, updated: Partial<Aisle>) => void;
removeAisle: (uuid: string) => void;
removePoint: (uuid: string) => Aisles;
clearAisles: () => void;
setPosition: (
pointUuid: string,
position: [number, number, number]
@@ -92,6 +93,12 @@ export const createAisleStore = () => {
return removedAisles;
},
clearAisles: () => {
set((state) => {
state.aisles = [];
})
},
setPosition: (pointUuid, position) => {
let updatedAisle: Aisle | undefined;
set((state) => {