// frontend/components/tasks/TreeNode.tsx "use client"; import { Icon } from "@/components/Icon"; import { cx } from "@/lib/cx"; import type { Project } from "@/lib/types"; interface Props { node: Project; depth: number; sel: string; onSelect: (id: string) => void; expanded: Record; onToggle: (id: string) => void; onPin: (id: string) => void; counts: Record; } export function TreeNode({ node, depth, sel, onSelect, expanded, onToggle, onPin, counts }: Props) { const hasCh = node.children.length > 0; const open = !!expanded[node.id]; return ( <>
onSelect(node.id)} > {hasCh ? ( ) : ( )} {node.name} {counts[node.id] > 0 && {counts[node.id]}}
{hasCh && open && node.children.map((c) => ( ))} ); }