feat: Add state filtering methods for ArmBot, Conveyor, Machine, StorageUnit, and Vehicle stores
This commit is contained in:
@@ -34,6 +34,7 @@ interface StorageUnitStore {
|
||||
// Helpers
|
||||
getStorageUnitById: (modelUuid: string) => StorageUnitStatus | undefined;
|
||||
getStorageUnitsByProduct: (productId: string) => StorageUnitStatus[];
|
||||
getStorageUnitsBystate: (state: string) => StorageUnitStatus[];
|
||||
getActiveStorageUnits: () => StorageUnitStatus[];
|
||||
getIdleStorageUnits: () => StorageUnitStatus[];
|
||||
getFullStorageUnits: () => StorageUnitStatus[];
|
||||
@@ -131,6 +132,10 @@ export const useStorageUnitStore = create<StorageUnitStore>()(
|
||||
return get().storageUnits.filter(s => s.productId === productId);
|
||||
},
|
||||
|
||||
getStorageUnitsBystate: (state) => {
|
||||
return get().storageUnits.filter(s => s.state === state);
|
||||
},
|
||||
|
||||
getActiveStorageUnits: () => {
|
||||
return get().storageUnits.filter(s => s.isActive);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user