{
if (hasChildren) toggle(node.id);
onNodeClick(node);
}}
style={{
display: "flex",
alignItems: "center",
gap: 6,
paddingLeft: 8 + depth * 14,
paddingRight: 8,
height: 26,
fontSize: 12,
cursor: "pointer",
color: active ? "var(--accent-strong)" : "var(--text)",
background: active ? "var(--selected)" : "transparent",
borderLeft: active ? "2px solid var(--accent)" : "2px solid transparent",
fontWeight: active ? 500 : 400,
}}
onMouseEnter={(e) => {
if (!active) e.currentTarget.style.background = "var(--bg-row-hover)";
}}
onMouseLeave={(e) => {
if (!active) e.currentTarget.style.background = "transparent";
}}
>
{hasChildren ? (
isOpen ? (
) : (
)
) : null}
{iconFor(node.icon)}
{node.label}
{node.badge && (
{node.badge}
)}
{hasChildren && isOpen && (
{node.children!.map((c) => renderNode(c, depth + 1))}
)}
);
};
return (
);
}