100 lines
3.0 KiB
TypeScript
100 lines
3.0 KiB
TypeScript
import { Link, usePage } from '@inertiajs/react';
|
|
import { BookOpen, FolderGit2, LayoutGrid } from 'lucide-react';
|
|
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 {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarFooter,
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
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,
|
|
},
|
|
];
|
|
|
|
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;
|
|
return (
|
|
<Sidebar collapsible="icon" variant="inset">
|
|
<SidebarHeader>
|
|
<SidebarMenu>
|
|
<SidebarMenuItem>
|
|
<SidebarMenuButton size="lg" asChild>
|
|
<Link href={dashboard()} prefetch>
|
|
<AppLogo />
|
|
</Link>
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
</SidebarMenu>
|
|
</SidebarHeader>
|
|
|
|
<SidebarContent>
|
|
<NavMain items={items} />
|
|
</SidebarContent>
|
|
|
|
<SidebarFooter>
|
|
<NavFooter items={footerNavItems} className="mt-auto" />
|
|
<NavUser />
|
|
</SidebarFooter>
|
|
</Sidebar>
|
|
);
|
|
}
|