feat: drill-down en pestaña nueva, rol Vendedor y scripts demo
This commit is contained in:
@@ -72,6 +72,11 @@ const adminNavigation: NavItem[] = [
|
||||
{ name: 'Audit Log', href: '/admin/audit-log', icon: FileWarning },
|
||||
];
|
||||
|
||||
const vendedorNavigation: NavItem[] = [
|
||||
{ name: 'Invitar cliente', href: '/admin/invitar-cliente', icon: Send },
|
||||
{ name: 'Configuracion', href: '/configuracion', icon: Settings },
|
||||
];
|
||||
|
||||
export function Sidebar() {
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
@@ -103,12 +108,15 @@ export function Sidebar() {
|
||||
|
||||
const { data: contribuyentes } = useContribuyentes();
|
||||
const isGlobalAdmin = isGlobalAdminRfc(user?.tenantRfc, role, user?.platformRoles);
|
||||
const isVendedor = user?.platformRoles?.includes('platform_sales') && !isGlobalAdmin;
|
||||
// El admin global NO necesita "Configuración inicial" — su tenant raíz
|
||||
// (Horux 360) no tiene contribuyentes propios y nunca los tendrá.
|
||||
const showOnboarding = (!contribuyentes || contribuyentes.length === 0) && role !== 'cliente' && !isGlobalAdmin;
|
||||
const showOnboarding = (!contribuyentes || contribuyentes.length === 0) && role !== 'cliente' && !isGlobalAdmin && !isVendedor;
|
||||
const allNavigation = isGlobalAdmin
|
||||
? [...filteredNav.slice(0, -1), ...adminNavigation, filteredNav[filteredNav.length - 1]]
|
||||
: filteredNav;
|
||||
: isVendedor
|
||||
? vendedorNavigation
|
||||
: filteredNav;
|
||||
|
||||
return (
|
||||
<aside className="fixed left-0 top-0 z-40 h-screen w-64 border-r bg-card">
|
||||
|
||||
Reference in New Issue
Block a user