Refactor simulation paths to simulation states

- Updated all instances of `simulationPaths` to `simulationStates` across multiple components including copyPasteControls, duplicationControls, moveControls, rotateControls, selectionControls, and others.
- Adjusted related state management hooks in the store to reflect the change from `simulationPaths` to `simulationStates`.
- Ensured that all references to simulation paths in the simulation logic and UI components are consistent with the new naming convention.
This commit is contained in:
2025-04-05 10:12:28 +05:30
parent 42f0ae5317
commit e92345d820
22 changed files with 260 additions and 333 deletions

View File

@@ -341,8 +341,8 @@ export const useSelectedPath = create<any>((set: any) => ({
}));
interface SimulationPathsStore {
simulationPaths: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
setSimulationPaths: (
simulationStates: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[];
setSimulationStates: (
paths:
| (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
| ((prev: (Types.ConveyorEventsSchema | Types.VehicleEventsSchema)[]
@@ -350,12 +350,12 @@ interface SimulationPathsStore {
) => void;
}
export const useSimulationPaths = create<SimulationPathsStore>((set) => ({
simulationPaths: [],
setSimulationPaths: (paths) =>
export const useSimulationStates = create<SimulationPathsStore>((set) => ({
simulationStates: [],
setSimulationStates: (paths) =>
set((state) => ({
simulationPaths:
typeof paths === "function" ? paths(state.simulationPaths) : paths,
simulationStates:
typeof paths === "function" ? paths(state.simulationStates) : paths,
})),
}))