feat: drill-down en pestaña nueva, rol Vendedor y scripts demo

This commit is contained in:
Horux Dev
2026-06-22 20:45:42 +00:00
parent 7df27ce66d
commit 3c7758a599
10 changed files with 705 additions and 16 deletions

View File

@@ -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">