import type { ToolCallMessagePartComponent } from "@assistant-ui/react"; import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; export const ToolFallback: ToolCallMessagePartComponent = ({ toolName, argsText, result, }) => { const [isCollapsed, setIsCollapsed] = useState(true); return (

Used tool: {toolName}

{!isCollapsed && (
              {argsText}
            
{result !== undefined && (

Result:

                {typeof result === "string"
                  ? result
                  : JSON.stringify(result, null, 2)}
              
)}
)}
); };