- {section.title}
+ {sections.map(section => {
+ const visible = section.items.filter(item => hasAccess(user?.role, item.requiredRole))
+ if (visible.length === 0) return null
+
+ return (
+
+
+ {section.title}
+
+ {visible.map(item => {
+ const isActive = activePath === item.path
+ return (
+
{
+ if (!isActive) e.currentTarget.style.background = 'var(--bg-hover)'
+ }}
+ onMouseLeave={e => {
+ if (!isActive) e.currentTarget.style.background = 'transparent'
+ }}
+ onClick={() => onNavigate(item.path)}
+ >
+
+ {item.icon}
+ {item.label}
+
+ {item.badge != null && item.badge > 0 && (
+ {item.badge}
+ )}
+
+ )
+ })}
- {section.items.map(item => {
- const isActive = activePath === item.path
- return (
-
{
- if (!isActive) e.currentTarget.style.background = 'var(--bg-hover)'
- }}
- onMouseLeave={e => {
- if (!isActive) e.currentTarget.style.background = 'transparent'
- }}
- onClick={() => onNavigate(item.path)}
- >
-
- {item.icon}
- {item.label}
-
- {item.badge != null && item.badge > 0 && (
- {item.badge}
- )}
-
- )
- })}
-