import Button from "@moduletrace/twui/layout/Button"; import Row from "@moduletrace/twui/layout/Row"; import Span from "@moduletrace/twui/layout/Span"; import { CircleAlert, 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 or tool the bot can use here, under the composer. One * that isn't working shows an alert icon, one that's off is struck out. */ export default function ComposerToolChip({ item, busy, onRemove }: Props) { const Icon = item.state == "error" ? CircleAlert : extensionIcon({ kind: item.kind }); const notes = [ item.detail, item.source == "workspace" ? "From this workspace" : "", !item.enabled ? "Off for every bot" : item.state == "error" ? "Not working" : "", ].filter(Boolean); return ( {item.name} {onRemove ? ( ) : null} ); }