import Button from "@moduletrace/twui/layout/Button"; import Row from "@moduletrace/twui/layout/Row"; import Span from "@moduletrace/twui/layout/Span"; import Stack from "@moduletrace/twui/layout/Stack"; import { AppWindow, Check } from "lucide-react"; import type { BUN_SQLITE_COBBLE_COMPUTERS } from "@/db/types/db"; type Props = { computer: BUN_SQLITE_COBBLE_COMPUTERS; /** * The computer the bot is on. */ current: boolean; onPick: () => void; /** * Opens the computer in the viewer. */ onOpen: () => void; }; /** * One computer in the header's computers modal, checked when it's the * one the bot is on, with a button that opens it. */ export default function BotComputerOption({ computer, current, onPick, onOpen }: Props) { const name = computer.name || `Computer ${computer.id}`; return ( { if (!current && (e.key == "Enter" || e.key == " ")) { e.preventDefault(); onPick(); } }} className={`grow min-w-0 min-h-9 gap-2.5! flex-nowrap items-center px-4 py-1.5 text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ink ${ current ? "cursor-default" : "cursor-pointer" }`} > {name} {computer.description ? ( {computer.description} ) : null} ); }