import type { SubagentRun, TodoItem, TodoStatus } from "./derive"; import type { TaskDerivation } from "./derive"; const STATUS_ICON: Record = { pending: "○", "in-progress": "◺", completed: "●", }; function TodoRow({ item }: { item: TodoItem }) { return (
{item.content}
); } function SubagentRow({ run }: { run: SubagentRun }) { return (
{run.running ? ( ) : ( )} {run.name} {run.running ? "running" : run.isError ? "failed" : "done"}
); } export default function TaskPanel({ tasks }: { tasks: TaskDerivation }) { const hasTodos: boolean = tasks.todos.length > 0; const hasSubagents: boolean = tasks.subagents.length > 0; const hasWorking: boolean = tasks.workingTools.length > 0; const empty: boolean = !hasTodos && !hasSubagents && !hasWorking; return (
{empty &&

No tasks yet.

} {hasTodos && (

Tasks

{tasks.todos.map((t) => ( ))}
)} {hasSubagents && (

Subagents

{tasks.subagents.map((s) => ( ))}
)} {hasWorking && (

Working

{tasks.workingTools.map((w) => (
{w.name}…
))}
)}
); }