"use client"; import "./components/ui/tidal.css"; import { useLayoutEffect, useRef, useState } from "react"; import { TidalAgentRun, type TidalRunStatus, type TidalRunStep } from "./components/ui/agent-run"; import "./components/ui/agent-run.css"; import "./components/ui/status-badge.css"; import "./components/ui/progress.css"; import "./components/ui/collapsible-panel.css"; const tidalExampleStyles = ".tidal-scope .agent-run-demo {\n width: min(100%, 640px);\n max-width: 640px;\n min-width: 0;\n}\n.tidal-scope .agent-run-demo-controls {\n display: flex;\n gap: 8px;\n flex-wrap: wrap;\n margin-top: 16px;\n}\n.tidal-scope .agent-run-demo-controls button {\n min-height: 44px;\n padding: 10px 14px;\n border: 1px solid var(--t-border);\n border-radius: 9px;\n background: var(--t-surface);\n color: var(--t-ink);\n font: inherit;\n font-size: 12px;\n}\n.tidal-scope .agent-run-demo-controls button:disabled {\n opacity: 0.45;\n}"; export function AgentRunDemo() { const advance = useRef(null), run = useRef(null); const [status, setStatus] = useState("running"), [step, setStep] = useState(1); useLayoutEffect(() => { if (status === "completed" && document.activeElement === advance.current) run.current ?.querySelector(".tidal-agent-run-note") ?.focus({ preventScroll: true }); }, [status]); const labels = [ "Read project notes", "Review open tasks", "Prepare a summary", ]; const steps: TidalRunStep[] = labels.map((label, i) => ({ id: String(i), label, status: status === "completed" || i < step ? "completed" : i === step && status === "running" ? "running" : "pending", description: ["3 sample documents", "5 sample tasks", "Markdown report"][i], content: [ "Release notes, design review and launch checklist.", "Two sample tasks need an owner before launch.", "The sample report is ready for review.", ][i], })); return (
setStatus("cancelled")} onRetry={() => { setStatus("running"); setStep(1); }} > {status === "completed" ? (

Two tasks need an owner. The mobile review is complete.

) : undefined}
); } export default function AgentExample() { return (
); }