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"; import extensionStateNote from "@/src/utils/extension-state-note"; 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, skill or knowledgebase the bot can use here, in * the composer's modals. One that isn't working says so * (`extensionStateNote`), one that's off is struck out. */ export default function ComposerToolRow({ item, busy, onRemove }: Props) { const Icon = extensionIcon({ kind: item.kind }); const notes = [ item.detail, item.source == "workspace" ? "From this workspace" : "", extensionStateNote({ item }), ].filter(Boolean); return ( {item.name} {notes.length ? ( {notes.join(" ยท ")} ) : null} {onRemove ? ( ) : null} ); }