Let agency configure each client's left-nav modules from the ficha.

Checkboxes match the sidebar (incl. Social sub-items), with a live preview and route guard so clients cannot open disabled sections.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-13 17:52:55 +02:00
parent d3e383dd08
commit fd2bd9582d
5 changed files with 278 additions and 81 deletions

View File

@@ -180,11 +180,13 @@ export default function DashboardShell({
const dateRange = useDateRange();
const pathname = usePathname();
const visibleNav = NAV_ITEMS.filter((item) => {
const moduleOn = (id: DashboardModuleId) => {
if (isAgency) return true;
if (!enabledModules) return true;
return enabledModules[item.moduleId] !== false;
});
return enabledModules[id] !== false;
};
const visibleNav = NAV_ITEMS.filter((item) => moduleOn(item.moduleId));
const showClientBrand = Boolean(clientLogoUrl);
const title = showClientBrand ? brandLabel || company : '4VENTURES';
@@ -249,22 +251,26 @@ export default function DashboardShell({
<NavLink item={item} onNavigate={close} />
{underSocial ? (
<>
<Link
href="/dashboard/calendario"
onClick={close}
className={subLinkCls('/dashboard/calendario')}
>
<CalendarDays className="w-3.5 h-3.5 shrink-0 text-pink-500" />
Calendario editorial
</Link>
<Link
href="/dashboard/creatives"
onClick={close}
className={subLinkCls('/dashboard/creatives')}
>
<Images className="w-3.5 h-3.5 shrink-0 text-fuchsia-500" />
Pipeline RRSS
</Link>
{moduleOn('calendario') ? (
<Link
href="/dashboard/calendario"
onClick={close}
className={subLinkCls('/dashboard/calendario')}
>
<CalendarDays className="w-3.5 h-3.5 shrink-0 text-pink-500" />
Calendario editorial
</Link>
) : null}
{moduleOn('pipeline') ? (
<Link
href="/dashboard/creatives"
onClick={close}
className={subLinkCls('/dashboard/creatives')}
>
<Images className="w-3.5 h-3.5 shrink-0 text-fuchsia-500" />
Pipeline RRSS
</Link>
) : null}
</>
) : null}
</div>