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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user