chore: fixed wrong imports and deleted some

unnecessary prints.

ref: N25B-142
This commit is contained in:
Björn Otgaar
2025-10-08 14:35:20 +02:00
parent ec4f45b984
commit 72d61e3985
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
import { mergeAriaLabelConfig } from '@xyflow/system';
import { useState, useEffect } from 'react'
import { useEffect } from 'react'
// Define the robot type
type Robot = {
@@ -21,7 +20,6 @@ export default function ConnectedRobots({
const eventSource = new EventSource("http://localhost:8000/sse");
eventSource.onmessage = (event) => {
try {
console.log("message received :", event.data)
const data = JSON.parse(event.data);
// Example: data = { event: "robot_connected", id: "pepper_robot1", name: "Pepper", port: 1234 }
@@ -69,6 +67,7 @@ export default function ConnectedRobots({
<h2>Connected Robots</h2>
<ul>
{connectedRobots.map(robot =>
// Map all the robots in an unordered list
<li key={robot.id}>
<strong>{robot.name}</strong> (ID: {robot.id}, Port: {robot.port === -1 ? "No given port" : robot.port})
</li>
@@ -100,6 +99,7 @@ export default function ConnectedRobots({
setConnectedRobots(robots => [...robots, randomConnectionDummy]);
}}>'Sent connected event'</button>
<button onClick={() => {
// Example disconnection bots
const disconnection_dummies = [
{ id: "pepper_robot1" },
{ id: "pepper_robot2" },