"use client"; import { Check, Loader2, X } from "lucide-react"; import { type ReactNode, useId } from "react"; import { cn } from "@/lib/utils"; export type ToolChipStatus = "running" | "done" | "error"; export interface ToolChipProps { /** Icon for the tool, such as a globe for web search. */ icon?: ReactNode; label: string; /** Default "done". */ status?: ToolChipStatus; className?: string; } const STATUS_CLASS: Record = { running: "text-muted-foreground", done: "text-success", error: "text-destructive", }; /** A small pill naming a tool an agent used, with a status mark that crossfades in place. */ export function ToolChip({ icon, label, status = "done", className }: ToolChipProps) { const id = useId(); return ( {icon ? ( ) : null} {label} ); }