'use client' import type { Span } from '../../types/observability.types' interface CompactTimelineProps { spans: Span[] className?: string } /** * Compact horizontal timeline showing execution flow with icons. * Shows: User → LLM → Tool (name) ✓/✗ → LLM → Response */ export function CompactTimeline({ spans, className = '' }: CompactTimelineProps) { // Filter to show only meaningful spans (LLM and tool) const meaningfulSpans = spans.filter( (span) => span.type === 'llm' || span.type === 'tool' ) if (meaningfulSpans.length === 0) { return null } const getSpanIcon = (span: Span) => { if (span.type === 'llm') return '🧠' if (span.type === 'tool') return '🔧' return '📦' } const getStatusIcon = (status: string) => { if (status === 'success') return '✓' if (status === 'error') return '✗' return '...' } const getStatusColor = (status: string) => { if (status === 'success') return 'text-green-600 dark:text-green-400' if (status === 'error') return 'text-red-600 dark:text-red-400' return 'text-yellow-600 dark:text-yellow-400' } return (