import { useState } from 'react'; import type { ToolCall } from '{{PACKAGE_SCOPE}}/core/shared/types.js'; import { MODEL_COLORS, MODEL_LABELS } from '{{PACKAGE_SCOPE}}/core/shared/types.js'; interface TimelineEntryProps { entry: ToolCall; } export function TimelineEntry({ entry }: TimelineEntryProps) { const [expanded, setExpanded] = useState(false); const color = MODEL_COLORS[entry.model]; return (
setExpanded(!expanded)} style={{ padding: 'var(--space-sm)', cursor: 'pointer', borderBottom: '1px solid var(--color-bg-tertiary)', }}>
{new Date(entry.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} {MODEL_LABELS[entry.model]} {entry.tool} {entry.target} {entry.status === 'running' && ( ... )}
{expanded && (entry.input || entry.output) && (
{entry.input && (
Input: {entry.input}
)} {entry.output && (
Output: {entry.output}
)} {entry.duration !== undefined && (
{entry.duration}ms
)}
)}
); }