"use client"; import type { CSSProperties } from "react"; import { useState } from "react"; import { highlight } from "@/lib/highlight"; const STEPS = [ { command: "zero init", output: 'Created zero.toml\nCreated zero.graph graph:e3b0c442\nInitialized package "hello"', }, { command: 'zero patch --op addMain --op \'addCheckWrite fn="main" text="hello from zero\\n"\'', output: "Patched zero.graph\n graph hash graph:a7f7e689\n symbols main", }, { command: "zero run", output: "hello from zero", }, ]; function TerminalIcon() { return ( ); } export function ChatToolRuns({ startDelayMs = 0 }: { startDelayMs?: number }) { const [open, setOpen] = useState([]); const toggle = (i: number) => setOpen((prev) => (prev.includes(i) ? prev.filter((n) => n !== i) : [...prev, i])); return ( {STEPS.map((step, i) => { const isOpen = open.includes(i); return ( toggle(i)} aria-expanded={isOpen} className="flex w-full cursor-pointer items-center gap-2 px-3 py-2 font-mono text-[0.78125rem] leading-relaxed text-muted transition-colors hover:bg-surface-muted" > {isOpen && ( {step.output} )} ); })} ); }
{step.output}