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 { X } from "lucide-react"; import extensionIcon from "@/src/components/general/extension-icon"; import type { BotExtension } from "@/src/types"; type Props = { item: BotExtension; busy?: boolean; /** * Takes it from the bot; not given for a workspace's own or when the * user can't. */ onRemove?: () => void; }; /** * One MCP server, tool or skill the bot can use here, in the composer's * tools modal. One that isn't working says so, one that's off is struck * out. A skill has nothing to connect or run, so it never reports one. */ export default function ComposerToolRow({ item, busy, onRemove }: Props) { const Icon = extensionIcon({ kind: item.kind }); const notes = [ item.detail, item.source == "workspace" ? "From this workspace" : "", !item.enabled ? "Off for every bot" : item.kind == "skill" ? "" : item.state == "error" ? "Not working" : item.state == "untested" ? "Not checked yet" : "", ].filter(Boolean); return ( {item.name} {notes.length ? ( {notes.join(" ยท ")} ) : null} {onRemove ? ( ) : null} ); }