oportunidades 5
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-10 14:15:28 +02:00
parent 6ddafc95ba
commit 01405cbf8a
144 changed files with 28903 additions and 1103 deletions
+34 -7
View File
@@ -1,3 +1,5 @@
import { profileLinks } from '@/components/profile-navigation';
import type { ProfileAccess } from '@/types/profile-access';
import { Link, usePage } from '@inertiajs/react';
import { LayoutGrid } from 'lucide-react';
import { portalNavigation } from '@/lib/portal-navigation';
@@ -15,27 +17,52 @@ import {
} from '@/components/ui/sidebar';
import { dashboard } from '@/routes';
import type { Auth } from '@/types';
import type { OpportunityManagementAccess } from '@/types/opportunity-management';
export function AppSidebar() {
const { auth, existingBusinessEnabled, educationEnabled, aiEnabled } =
usePage<{
auth: Auth;
existingBusinessEnabled?: boolean;
educationEnabled?: boolean;
aiEnabled?: boolean;
}>().props;
const {
auth,
existingBusinessEnabled,
educationEnabled,
aiEnabled,
opportunityManagement,
profileAccess,
} = usePage<{
auth: Auth;
existingBusinessEnabled?: boolean;
educationEnabled?: boolean;
aiEnabled?: boolean;
profileAccess?: ProfileAccess | null;
opportunityManagement?: OpportunityManagementAccess | null;
}>().props;
const groups = portalNavigation({
authenticated: !!auth.user,
manager: auth.canManagePortal,
businesses: existingBusinessEnabled,
education: educationEnabled,
ai: aiEnabled,
opportunityManagement,
});
const items = groups.map((group) => ({
title: group.label,
href: group.children?.find((item) => item.href)?.href ?? '/',
icon: LayoutGrid,
}));
if (auth.canManagePortal && opportunityManagement) {
items.push({
title: opportunityManagement.manage.label,
href: opportunityManagement.manage.href,
icon: LayoutGrid,
});
if (opportunityManagement.installed) {
items.push({
title: opportunityManagement.create.label,
href: opportunityManagement.create.href,
icon: LayoutGrid,
});
}
}
items.push(...profileLinks(profileAccess).map(link => ({...link, icon: LayoutGrid})));
return (
<Sidebar collapsible="icon" variant="inset">
<SidebarHeader>