import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalAgentTaskList, type TidalAgentTask, type TidalAgentTaskStatus } from "./components/ui/agent-task-list"; import "./components/ui/agent-task-list.css"; const tidalExampleStyles = ".agent-task-demo {\n display: grid;\n width: 100%;\n max-width: 920px;\n min-width: 0;\n gap: 10px;\n margin-inline: auto;\n}\n.agent-task-demo > footer {\n margin: 0;\n padding: 0;\n border: 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.45;\n text-align: center;\n}"; const initialTasks: readonly TidalAgentTask[] = [ { id: "brief", title: "Read the sample project brief", status: "completed", assignee: "Ava", detail: "The goals and constraints are ready for the run.", }, { id: "interface", title: "Draft the settings interface", status: "active", assignee: "Noah", dependsOn: ["brief"], description: "Preparing the responsive form and review state.", }, { id: "copy", title: "Review empty-state copy", status: "blocked", assignee: "Mila", dependsOn: ["interface"], blockedReason: "Waiting for the interface draft.", }, { id: "qa", title: "Check the phone layout", status: "queued", dependsOn: ["interface"], }, ]; export function AgentTaskListDemo() { const [tasks, setTasks] = useState(initialTasks), [filter, setFilter] = useState<"all" | TidalAgentTaskStatus>("all"), [expanded, setExpanded] = useState(["interface"]), [status, setStatus] = useState( "Sample tasks. Changes stay in this preview.", ); return (
{ setTasks((current) => current.map((item) => item.id === task.id ? { ...item, status: "cancelled" } : item, ), ); setStatus(`${task.title} was cancelled locally.`); }} onRetry={(task) => { setTasks((current) => current.map((item) => item.id === task.id ? { ...item, status: "queued" } : item, ), ); setStatus(`${task.title} returned to the local queue.`); }} />
{status}
); } export default function AgentExample() { return (
); }