import { useState, type Dispatch, type SetStateAction } from "react"; import API_URL from "../config"; import "../styles/button.css"; import "../styles/sidebar.css"; import type { Robot } from "../types/robot"; import AddRobotForm from "./AddRobotForm"; import ErrorBanner from "./ErrorBanner"; import RobotList from "./RobotList"; import SimulationActions from "./SimulationActions"; type Props = { activeSimulation: boolean; errorMessage: string; robots: Robot[]; token: string | null; setActiveSimulation: Dispatch>; setErrorMessage: Dispatch>; setRobots: Dispatch>; }; function Sidebar({ activeSimulation, errorMessage, robots, token, setActiveSimulation, setErrorMessage, setRobots, }: Props) { const [isAddingRobot, setIsAddingRobot] = useState(false); function handleAddClick() { setIsAddingRobot(true); setErrorMessage(""); } return (

Your Robots

{isAddingRobot && ( )} {errorMessage && }
); } export default Sidebar;