feat: Show connected robots finished with unit test 94% coverage

ref: N25B-142
This commit is contained in:
Björn Otgaar
2025-10-30 15:47:09 +01:00
parent 6a88aa3d75
commit 5e707224cf
4 changed files with 207 additions and 21 deletions

View File

@@ -1,5 +1,4 @@
import { Routes, Route, Link } from 'react-router'
import { useState } from 'react'
import './App.css'
import TemplatePage from './pages/TemplatePage/Template.tsx'
import Home from './pages/Home/Home.tsx'
@@ -9,16 +8,6 @@ import VisProg from "./pages/VisProgPage/VisProg.tsx";
function App(){
// Define what our conencted robot should include
type Robot = {
id: string;
name: string;
port: number;
};
// (Acces to) the array of connected robots
const [connectedRobots, setConnectedRobots] = useState<Robot[]>([]);
return (
<div>
<header>
@@ -30,16 +19,7 @@ function App(){
<Route path="/template" element={<TemplatePage />} />
<Route path="/editor" element={<VisProg />} />
<Route path="/robot" element={<Robot />} />
<Route
path="/ConnectedRobots"
// Pass the useState to the page to update from there
element={
<ConnectedRobots
connectedRobots={connectedRobots}
setConnectedRobots={setConnectedRobots}
/>
}
/>
<Route path="/ConnectedRobots" element={<ConnectedRobots />} />
</Routes>
</main>
</div>