import type { ReactNode } from 'react' import { AlertTriangle, Bot, CircleDot, Clock3, FileJson2, GitBranch, MessageSquareText, RadioTower, Sparkles, Wrench, } from 'lucide-react' import { useTranslation } from '../../i18n' import type { TraceSpan, TraceSpanStatus } from '../../lib/traceViewModel' type TraceTranslator = ReturnType export function TypeIcon({ span, size = 14 }: { span: TraceSpan; size?: number }) { const { icon, className } = iconForSpan(span, size) return ( ) } function iconForSpan(span: TraceSpan, size: number): { icon: ReactNode; className: string } { const tertiary = 'text-[var(--color-text-tertiary)]' switch (span.kind) { case 'llm': return { icon: , className: 'text-[var(--color-brand)]' } case 'tool': return { icon: , className: 'text-[var(--color-warning)]' } case 'tool_result': return { icon: , className: tertiary } case 'turn': return { icon: , className: tertiary } case 'session': return { icon: , className: tertiary } case 'event': return span.status === 'error' ? { icon: , className: 'text-[var(--color-error)]' } : { icon: , className: tertiary } case 'message': if (span.message?.type === 'assistant') { return { icon: , className: tertiary } } if (span.message?.type === 'system') { return { icon: , className: tertiary } } return { icon: , className: tertiary } default: return { icon: , className: tertiary } } } export function StatusGlyph({ status }: { status: TraceSpanStatus }) { if (status === 'error') { return