"use client"; import { Zap, Wrench, Flag, AlertCircle, Loader2, CheckCircle, XCircle } from "lucide-react"; import { cn } from "@/lib/utils"; import type { ActivityNode } from "@/lib/api"; interface ActivityTimelineProps { nodes: ActivityNode[]; } const TYPE_ICON: Record> = { status: Zap, tool: Wrench, done: Flag, error: AlertCircle, }; function NodeIcon({ node }: { node: ActivityNode }) { if (node.nodeStatus === "running") { return ; } if (node.nodeStatus === "success") { return ; } if (node.nodeStatus === "error") { return ; } const Icon = TYPE_ICON[node.type] ?? Zap; return ; } export function ActivityTimeline({ nodes }: ActivityTimelineProps) { if (nodes.length === 0) return null; return (
{nodes.map((node, i) => (
{i < nodes.length - 1 && (
)}

{node.label}

{node.detail && (

{node.detail}

)}
))}
); }