import { useState, type JSX } from "react"; import { ChevronDown, ChevronRight } from "lucide-react"; import type { WorkspaceAgentActivityTimelineItem } from "../../workspaceAgentTimelineTypes"; import { CollapsibleReveal } from "./CollapsibleReveal"; interface RawTimelineJsonDisclosureProps { items: readonly WorkspaceAgentActivityTimelineItem[] | null | undefined; label: string; } export function RawTimelineJsonDisclosure({ items, label }: RawTimelineJsonDisclosureProps): JSX.Element | null { "use memo"; const [expanded, setExpanded] = useState(false); const json = rawTimelineJson(items); if (!json) { return null; } return (
          {json}
        
); } function rawTimelineJson( items: readonly WorkspaceAgentActivityTimelineItem[] | null | undefined ): string | null { if (!items || items.length === 0) { return null; } try { return JSON.stringify(items.length === 1 ? items[0] : items, null, 2); } catch { return null; } }