{section.label && (
<>
{sIdx > 0 &&
}
0 ? 4 : 0}>
{section.label}
>
)}
{section.items.map((item: any) =>
item.children && !item.path ? (
// Collapsible group without a parent route (e.g. Reports)
}
defaultOpened={item.children.some((c: any) =>
location.pathname.startsWith(c.path),
)}
data-tour={item.tourId || undefined}
>
{item.children.map((child: any) => (
go(child.path)}
/>
))}
) : item.children && item.path ? (
// Parent with its own route + nested children (e.g. Projects > Capital Planning)
}
defaultOpened={
location.pathname === item.path ||
item.children.some((c: any) => location.pathname.startsWith(c.path))
}
data-tour={item.tourId || undefined}
active={location.pathname === item.path}
onClick={() => go(item.path!)}
>
{item.children.map((child: any) => (
{ e.stopPropagation(); go(child.path); }}
/>
))}
) : (
}
active={location.pathname === item.path}
onClick={() => go(item.path!)}
data-tour={item.tourId || undefined}
/>
),
)}
))}
{user?.isSuperadmin && (
<>