"use client"; import { useState } from "react"; import { Settings, Gamepad2, Trash2, Pencil, Plus, ExternalLink, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardFooter } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@/components/ui/alert-dialog"; import { cn } from "@/lib/utils"; import HudCorners from "@/components/hud-corners"; import { getUnifiedRobotData } from "@/lib/unified-storage"; import type { RobotConnection } from "@/types/robot"; interface DeviceDashboardProps { robots: RobotConnection[]; onCalibrate: (robot: RobotConnection) => void; onTeleoperate: (robot: RobotConnection) => void; onRemove: (robotId: string) => void; onEdit: (robot: RobotConnection) => void; onFindNew: () => void; isConnecting: boolean; onScrollToHardware: () => void; } export function DeviceDashboard({ robots, onCalibrate, onTeleoperate, onRemove, onEdit, onFindNew, isConnecting, onScrollToHardware, }: DeviceDashboardProps) { const [robotToRemove, setRobotToRemove] = useState( null ); const handleRemoveClick = (robot: RobotConnection) => { setRobotToRemove(robot); }; const handleConfirmRemove = () => { if (robotToRemove) { onRemove( robotToRemove.robotId || robotToRemove.serialNumber || "unknown" ); setRobotToRemove(null); } }; const handleCancelRemove = () => { setRobotToRemove(null); }; return ( <>

device registry

currently supports SO-100{" "}
{robots.length > 0 && ( )}
{robots.length === 0 ? (
{isConnecting ? ( <>

scanning for units

searching for available devices...

) : ( <>

no units detected

)}
) : (
{robots.map((robot) => (

{robot.name}

{robot.isConnected ? "ONLINE" : "OFFLINE"}
serial number
{robot.serialNumber}
type
{robot.robotType}
))}
)}
setRobotToRemove(null)} > Remove Robot Are you sure you want to remove{" "} {robotToRemove?.name || robotToRemove?.robotId}{" "} from the device registry?

This will permanently delete all stored calibration data and settings for this robot. This action cannot be undone.
Cancel Remove Robot
); }