import React from 'react'; import ClockIcon from '@/components/icons/ClockIcon'; import FunctionsIcon from '@/components/icons/FunctionsIcon'; export type ProcessedFunctionCallItem = { type: 'function_call'; name: string; arguments: string; id: string; callId: string; output?: string; status: 'completed' | 'in_progress'; }; type FunctionCallMessageProps = { message: ProcessedFunctionCallItem; }; export function FunctionCallMessage({ message }: FunctionCallMessageProps) { let output = message?.output; try { if (message.output) { output = JSON.stringify(JSON.parse(message.output), null, 2); } } catch { output = message.output; } return (
{message.status === 'completed' ? `Called ${message.name}` : `Calling ${message.name}...`}
                {JSON.stringify(JSON.parse(message.arguments), null, 2)}
              
{output ? (
{output}
) : (
Waiting for result...
)}
); }