refactor: rename position handlers to startPoint and endPoint for clarity; update toggle UI logic to use localStorage

This commit is contained in:
2025-03-29 13:57:39 +05:30
parent 1cca51e652
commit c2dc898d53
3 changed files with 18 additions and 26 deletions

View File

@@ -45,11 +45,11 @@ const VehicleMechanics: React.FC = () => {
setSimulationPaths(updatedPaths);
}, [selectedActionSphere?.point?.uuid, simulationPaths, setSimulationPaths]);
const handleStartPositionChange = React.useCallback((position: string) => {
const handleStartPointChange = React.useCallback((position: string) => {
handleActionUpdate({ start: position });
}, [handleActionUpdate]);
const handleEndPositionChange = React.useCallback((position: string) => {
const handleEndPointChange = React.useCallback((position: string) => {
handleActionUpdate({ end: position });
}, [handleActionUpdate]);
@@ -94,16 +94,16 @@ const VehicleMechanics: React.FC = () => {
<>
<EyeDropInput
key={`start-${selectedPoint.uuid}`}
label="Start Position"
label="Start Point"
value={selectedPoint.actions.start}
onChange={handleStartPositionChange}
onChange={handleStartPointChange}
/>
<EyeDropInput
key={`end-${selectedPoint.uuid}`}
label="End Position"
label="End Point"
value={selectedPoint.actions.end}
onChange={handleEndPositionChange}
onChange={handleEndPointChange}
/>
<InputWithDropDown