diff --git a/src/components/DashboardShell.tsx b/src/components/DashboardShell.tsx index 7c0da5e..8793b69 100644 --- a/src/components/DashboardShell.tsx +++ b/src/components/DashboardShell.tsx @@ -61,6 +61,20 @@ const NAV_ITEMS: NavItem[] = [ iconClass: 'text-brand-500', moduleId: 'kpis', }, + { + href: '/dashboard/calendario', + label: 'Calendario editorial', + icon: CalendarDays, + iconClass: 'text-amber-500', + moduleId: 'calendario', + }, + { + href: '/dashboard/creatives', + label: 'Pipeline RRSS', + icon: Images, + iconClass: 'text-pink-500', + moduleId: 'pipeline', + }, { href: '/dashboard/marca', label: 'Zona de marca', @@ -229,11 +243,6 @@ export default function DashboardShell({ const pathname = usePathname(); const showDateHeader = shouldShowDateHeader(pathname); - const isSocialRoute = - pathname === '/dashboard/social' || - pathname === '/dashboard/calendario' || - pathname === '/dashboard/creatives'; - const isAgenciaRoute = pathname === '/dashboard/agencia' || (pathname !== null && pathname.startsWith('/dashboard/agencia/')); @@ -245,24 +254,22 @@ export default function DashboardShell({ (pathname !== null && pathname.startsWith('/dashboard/crm/')) || pathname === '/dashboard/ad-tracker' || (pathname !== null && pathname.startsWith('/dashboard/ad-tracker/')) || - isSocialRoute || + pathname === '/dashboard/social' || + (pathname !== null && pathname.startsWith('/dashboard/social/')) || pathname === '/dashboard/organico' || (pathname !== null && pathname.startsWith('/dashboard/organico/')); const [expandedSections, setExpandedSections] = useState>({}); const isMetricasOpen = expandedSections['metricas'] ?? isMetricasRoute; - const isSocialOpen = expandedSections['social'] ?? isSocialRoute; const isAgenciaOpen = expandedSections['agencia'] ?? isAgenciaRoute; - const toggleSection = (key: 'metricas' | 'social' | 'agencia') => { + const toggleSection = (key: 'metricas' | 'agencia') => { setExpandedSections((prev) => { const current = key === 'metricas' ? (prev['metricas'] ?? isMetricasRoute) - : key === 'social' - ? (prev['social'] ?? isSocialRoute) - : (prev['agencia'] ?? isAgenciaRoute); + : (prev['agencia'] ?? isAgenciaRoute); return { ...prev, [key]: !current, @@ -368,86 +375,20 @@ export default function DashboardShell({ ) : null} {moduleOn('social') ? ( -
- { - if (moduleOn('calendario') || moduleOn('pipeline')) { - if (pathname === '/dashboard/social') { - e.preventDefault(); - toggleSection('social'); - return; - } else if (!isSocialOpen) { - toggleSection('social'); - } - } - close(); - }} - className={`${subLinkCls('/dashboard/social')} justify-between`} - > -
- - Social -
- {moduleOn('calendario') || moduleOn('pipeline') ? ( - { - e.preventDefault(); - e.stopPropagation(); - toggleSection('social'); - }} - className="p-0.5 rounded hover:bg-white/10 text-mist-400 hover:text-white transition-colors shrink-0" - aria-label={isSocialOpen ? 'Ocultar páginas' : 'Mostrar páginas'} - > - - - ) : null} - - {isSocialOpen ? ( -
- {moduleOn('calendario') ? ( - - - Calendario editorial - - ) : null} - {moduleOn('pipeline') ? ( - - - Pipeline RRSS - - ) : null} -
- ) : null} -
+ + + Social + ) : null} {moduleOn('organico') ? (