{/* Children */}
{isExpanded && hasChildren && (
0 ? "1px solid var(--color-border)" : "none",
marginLeft: `${depth * 16 + 16}px`,
}}
>
{node.children!.map((child) => (
))}
)}
);
}
// --- Exported Tree Component ---
export function KnowledgeTree({
tree,
activePath,
onSelect,
}: {
tree: TreeNode[];
activePath: string | null;
onSelect: (node: TreeNode) => void;
}) {
const [expandedPaths, setExpandedPaths] = useState