import React, { useState } from "react"; import { Settings, Trash2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { RobotRecord } from "@/hooks/useRobots"; import RobotSelector from "./RobotSelector"; interface RobotTileProps { robot: RobotRecord | null; selectedName: string | null; availableNames: string[]; isLoading: boolean; onSelect: (name: string) => void; onCreateNew: (name: string) => Promise; onConfigure: (name: string) => void; onTeleop: (robot: RobotRecord) => void; onDelete: (name: string) => void; } const RobotTile: React.FC = ({ robot, selectedName, availableNames, isLoading, onSelect, onCreateNew, onConfigure, onTeleop, onDelete, }) => { const [confirmDelete, setConfirmDelete] = useState(false); const status = robot ? (robot.is_clean ? "Ready" : "Needs configuration") : null; const teleopDisabled = !robot || !robot.is_clean; return (
{status && (

{status}

)} {robot && (
Configure (calibrate) Delete robot config
)}
{robot && (
{teleopDisabled && ( Configure the robot first. )}
)} {robot && ( Delete robot config? This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone. )}
); }; export default RobotTile;