// frontend/components/tasks/SubRow.tsx — 재귀 하위작업 행 (드릴다운) "use client"; import { Icon } from "@/components/Icon"; import { cx } from "@/lib/cx"; import { dueLabel, stat } from "@/lib/tasks/tree"; import type { Person, Task } from "@/lib/types"; import { Av } from "./bits"; interface Props { node: Task; depth: number; people: Record; expanded: Record; onExpand: (id: string) => void; onCheck: (id: string) => void; onFocus: (id: string) => void; } export function SubRow({ node, depth, people, expanded, onExpand, onCheck, onFocus }: Props) { const has = !!(node.children && node.children.length); const open = !!expanded[node.id]; const s = stat(node); const done = node.status === "done"; return ( <>
onFocus(node.id)} > {has ? ( ) : ( )}
{ e.stopPropagation(); onCheck(node.id); }} role="checkbox" aria-checked={done} aria-label="완료 토글" >
{node.title}
{has && ( {s.done}/{s.total} )} {node.est && ( {node.est} )} {node.due && ( {dueLabel(node.due)} )}
{has && open && (
{node.children.map((c) => ( ))}
)} ); }