"use client"; import { useState } from "react"; import { InfoTooltip } from "~/components/ui/InfoTooltip.js"; import { trpc } from "~/lib/trpc/client.js"; type ClientRow = { id: string; name: string; code: string | null; parentId: string | null; sortOrder: number; isActive: boolean; }; type ClientNode = ClientRow & { children: ClientNode[] }; type EditingClient = { id?: string; name: string; code: string; parentId: string; sortOrder: number; }; function ClientTreeNode({ node, onEdit, onAddChild, depth = 0, }: { node: ClientNode; onEdit: (c: ClientRow) => void; onAddChild: (parentId: string) => void; depth?: number; }) { const [expanded, setExpanded] = useState(depth < 1); const hasChildren = node.children.length > 0; return (
Client hierarchy for project assignment and chargeability reporting