import { useState } from "react"; import { ChevronRight } from "lucide-react"; import type { ReactNode } from "react"; import { formatElapsed } from "@/lib/utils"; /** * Collapses a finished agent turn's working steps (reasoning, tool calls, * exploration, edits, …) behind a single "Worked for …" toggle so the * transcript shows only the final reply by default. */ export function WorkSummary({ durationMs, children, }: { durationMs: number | null; children: ReactNode; }) { const [expanded, setExpanded] = useState(false); const label = durationMs && durationMs >= 1000 ? `Worked for ${formatElapsed(durationMs)}` : "Worked"; return (