{
- if (isGroup || hasChildren) {
- setCollapsedGroups(prev => ({
- ...prev,
- [item.id]: !prev[item.id]
- }));
- } else if (item.path) {
+ if (!(isGroup || hasChildren) && item.path) {
navigate(item.path);
}
}}
@@ -464,14 +456,15 @@ const AppLayout: React.FC = () => {
justifyContent: 'flex-start',
gap: 10,
padding: depth > 0 ? '6px 12px 6px 32px' : '6px 14px',
- borderRadius: 12, margin: '1px 4px', cursor: 'pointer',
+ borderRadius: 12, margin: '1px 4px',
+ cursor: isGroup || hasChildren ? 'default' : 'pointer',
fontSize: depth > 0 ? 13 : 14, fontWeight: isActive ? 600 : 400,
color: isActive ? '#4f46e5' : (isGroup ? '#94a3b8' : '#475569'),
background: isActive ? 'linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%)' : 'transparent',
transition: 'all 0.2s ease',
}}
onMouseEnter={(e) => {
- if (!isGroup && !isActive) {
+ if (!isGroup && !isActive && !(isGroup || hasChildren)) {
e.currentTarget.style.background = 'rgba(99, 102, 241, 0.05)';
}
}}
@@ -491,19 +484,9 @@ const AppLayout: React.FC = () => {
0 ? 13 : 14), textTransform: isGroup ? 'uppercase' : 'none', letterSpacing: isGroup ? 0.5 : 0 }}>
{item.label}
- {(isGroup || hasChildren) && (
-
-
-
- )}
- {(isGroup || hasChildren) && isExpanded && (
+ {(isGroup || hasChildren) && (
{(childMap[item.id] || []).map(c => renderMenuItem(c, depth + 1))}