diff --git a/src/components/DashboardShell.tsx b/src/components/DashboardShell.tsx index 8793b69..8ba5b9e 100644 --- a/src/components/DashboardShell.tsx +++ b/src/components/DashboardShell.tsx @@ -75,13 +75,6 @@ const NAV_ITEMS: NavItem[] = [ iconClass: 'text-pink-500', moduleId: 'pipeline', }, - { - href: '/dashboard/marca', - label: 'Zona de marca', - icon: BookMarked, - iconClass: 'text-rose-500', - moduleId: 'marca', - }, { href: '/dashboard/activos', label: 'Biblioteca de Activos', @@ -259,17 +252,26 @@ export default function DashboardShell({ pathname === '/dashboard/organico' || (pathname !== null && pathname.startsWith('/dashboard/organico/')); + const isActivosRoute = + pathname === '/dashboard/activos' || + (pathname !== null && pathname.startsWith('/dashboard/activos/')) || + pathname === '/dashboard/marca' || + (pathname !== null && pathname.startsWith('/dashboard/marca/')); + const [expandedSections, setExpandedSections] = useState>({}); const isMetricasOpen = expandedSections['metricas'] ?? isMetricasRoute; + const isActivosOpen = expandedSections['activos'] ?? isActivosRoute; const isAgenciaOpen = expandedSections['agencia'] ?? isAgenciaRoute; - const toggleSection = (key: 'metricas' | 'agencia') => { + const toggleSection = (key: 'metricas' | 'activos' | 'agencia') => { setExpandedSections((prev) => { const current = key === 'metricas' ? (prev['metricas'] ?? isMetricasRoute) - : (prev['agencia'] ?? isAgenciaRoute); + : key === 'activos' + ? (prev['activos'] ?? isActivosRoute) + : (prev['agencia'] ?? isAgenciaRoute); return { ...prev, [key]: !current, @@ -293,6 +295,9 @@ export default function DashboardShell({ moduleOn('organico') ); } + if (item.moduleId === 'activos') { + return moduleOn('activos') || moduleOn('marca'); + } return moduleOn(item.moduleId); }; @@ -329,13 +334,22 @@ export default function DashboardShell({