import type { FunctionCall } from '@/lib/functionCallParser'; import { formatDuration } from '@/lib/functionCallParser'; import { cn } from '@/lib/utils'; import { CheckCircle2, Clock, Loader2, ShieldAlert, ShieldCheck, ShieldX } from 'lucide-react'; interface FunctionCallBadgeProps { functionCall: FunctionCall; className?: string; } export function FunctionCallBadge({ functionCall, className }: FunctionCallBadgeProps) { const { functionName, status, duration, authStatus } = functionCall; return (
{status === 'running' ? ( ) : ( )} {functionName} {authStatus && ( {authStatus === 'pending' && } {authStatus === 'approved' && } {authStatus === 'denied' && } {authStatus} )} {status === 'completed' && duration !== undefined && ( <> {formatDuration(duration)} )}
); }