diff options
| author | Arne Rief <riearn@proton.me> | 2025-12-22 21:20:39 +0100 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2025-12-22 21:20:39 +0100 |
| commit | e836e7dd4ed5e9fa60e949d159100040b22a8f48 (patch) | |
| tree | a11954c06e55e8ef53fcb634fa5954dfcb42ffc3 /frontend/src/components/Sidebar.tsx | |
| parent | d1b64ddd78d8b8dc3eca76038a75071ab2a575d9 (diff) | |
Movement simulator for all and single robot, project v1 ready
Diffstat (limited to 'frontend/src/components/Sidebar.tsx')
| -rw-r--r-- | frontend/src/components/Sidebar.tsx | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 8bd795b..3760d4e 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -8,13 +8,24 @@ import RobotList from "./RobotList"; import SimulationActions from "./SimulationActions"; type Props = { + activeSimulation: boolean; errorMessage: string; robots: Robot[]; token: string | null; + setActiveSimulation: Dispatch<SetStateAction<boolean>>; setErrorMessage: Dispatch<SetStateAction<string>>; + setRobots: Dispatch<SetStateAction<Robot[]>>; }; -function Sidebar({ errorMessage, robots, token, setErrorMessage }: Props) { +function Sidebar({ + activeSimulation, + errorMessage, + robots, + token, + setActiveSimulation, + setErrorMessage, + setRobots, +}: Props) { const [isAddingRobot, setIsAddingRobot] = useState(false); function handleAddClick() { @@ -35,13 +46,15 @@ function Sidebar({ errorMessage, robots, token, setErrorMessage }: Props) { </button> </div> - {isAddingRobot && ( + {isAddingRobot && ( <AddRobotForm apiUrl={API_URL} errorMessage={errorMessage} + robots={robots} token={token} setErrorMessage={setErrorMessage} setIsAddingRobot={setIsAddingRobot} + setRobots={setRobots} /> )} @@ -50,12 +63,19 @@ function Sidebar({ errorMessage, robots, token, setErrorMessage }: Props) { )} <SimulationActions + activeSimulation={activeSimulation} apiUrl={API_URL} token={token} + setActiveSimulation={setActiveSimulation} setErrorMessage={setErrorMessage} /> - <RobotList robots={robots} /> + <RobotList + apiUrl={API_URL} + robots={robots} + token={token} + setErrorMessage={setErrorMessage} + /> </div> ); } |
