@@ -1,7 +1,7 @@
|
||||
import { Link, usePage } from '@inertiajs/react';
|
||||
import { BookOpen, FolderGit2, LayoutGrid } from 'lucide-react';
|
||||
import { LayoutGrid } from 'lucide-react';
|
||||
import { portalNavigation } from '@/lib/portal-navigation';
|
||||
import AppLogo from '@/components/app-logo';
|
||||
import { NavFooter } from '@/components/nav-footer';
|
||||
import { NavMain } from '@/components/nav-main';
|
||||
import { NavUser } from '@/components/nav-user';
|
||||
import {
|
||||
@@ -14,64 +14,28 @@ import {
|
||||
SidebarMenuItem,
|
||||
} from '@/components/ui/sidebar';
|
||||
import { dashboard } from '@/routes';
|
||||
import type { NavItem, Auth } from '@/types';
|
||||
|
||||
const mainNavItems: NavItem[] = [
|
||||
{ title: 'Painel do investidor', href: '/investidor', icon: LayoutGrid },
|
||||
{ title: 'Corredores e clusters', href: '/carteira', icon: LayoutGrid },
|
||||
{
|
||||
title: 'Dashboard',
|
||||
href: dashboard(),
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
];
|
||||
|
||||
const footerNavItems: NavItem[] = [
|
||||
{
|
||||
title: 'Repository',
|
||||
href: 'https://github.com/laravel/react-starter-kit',
|
||||
icon: FolderGit2,
|
||||
},
|
||||
{
|
||||
title: 'Documentation',
|
||||
href: 'https://laravel.com/docs/starter-kits#react',
|
||||
icon: BookOpen,
|
||||
},
|
||||
];
|
||||
import type { Auth } from '@/types';
|
||||
|
||||
export function AppSidebar() {
|
||||
const { auth } = usePage<{ auth: Auth }>().props;
|
||||
const items = auth.canManagePortal
|
||||
? [
|
||||
...mainNavItems,
|
||||
{
|
||||
title: 'Pedidos de interesse',
|
||||
href: '/management/interests',
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
{
|
||||
title: 'Sectores',
|
||||
href: '/management/sectors',
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
{
|
||||
title: 'Oportunidades',
|
||||
href: '/management/opportunities',
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
{ title: 'CRM', href: '/management/crm/leads', icon: LayoutGrid },
|
||||
{
|
||||
title: 'Projectos',
|
||||
href: '/management/projects',
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
{
|
||||
title: 'Clusters',
|
||||
href: '/management/clusters',
|
||||
icon: LayoutGrid,
|
||||
},
|
||||
]
|
||||
: mainNavItems;
|
||||
const { auth, existingBusinessEnabled, educationEnabled, aiEnabled } =
|
||||
usePage<{
|
||||
auth: Auth;
|
||||
existingBusinessEnabled?: boolean;
|
||||
educationEnabled?: boolean;
|
||||
aiEnabled?: boolean;
|
||||
}>().props;
|
||||
const groups = portalNavigation({
|
||||
authenticated: !!auth.user,
|
||||
manager: auth.canManagePortal,
|
||||
businesses: existingBusinessEnabled,
|
||||
education: educationEnabled,
|
||||
ai: aiEnabled,
|
||||
});
|
||||
const items = groups.map((group) => ({
|
||||
title: group.label,
|
||||
href: group.children?.find((item) => item.href)?.href ?? '/',
|
||||
icon: LayoutGrid,
|
||||
}));
|
||||
return (
|
||||
<Sidebar collapsible="icon" variant="inset">
|
||||
<SidebarHeader>
|
||||
@@ -91,7 +55,6 @@ export function AppSidebar() {
|
||||
</SidebarContent>
|
||||
|
||||
<SidebarFooter>
|
||||
<NavFooter items={footerNavItems} className="mt-auto" />
|
||||
<NavUser />
|
||||
</SidebarFooter>
|
||||
</Sidebar>
|
||||
|
||||
Reference in New Issue
Block a user