From e836e7dd4ed5e9fa60e949d159100040b22a8f48 Mon Sep 17 00:00:00 2001
From: Arne Rief <riearn@proton.me>
Date: Mon, 22 Dec 2025 21:20:39 +0100
Subject: Movement simulator for all and single robot, project v1 ready

---
 frontend/src/components/Sidebar.tsx | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

(limited to 'frontend/src/components/Sidebar.tsx')

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>
     );
 }
-- 
cgit v1.2.3

