| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import { Link } from '@inertiajs/react';
- import { CreditCard, LayoutGrid } from 'lucide-react';
- import BillingController from '@/actions/App/Http/Controllers/BillingController';
- import AppLogo from '@/components/app-logo';
- import { NavMain } from '@/components/nav-main';
- import { NavPlan } from '@/components/nav-plan';
- import { NavStores } from '@/components/nav-stores';
- 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 } from '@/types';
-
- const overviewItems: NavItem[] = [
- {
- title: 'Overview',
- href: dashboard(),
- icon: LayoutGrid,
- },
- ];
-
- const accountItems: NavItem[] = [
- {
- title: 'Billing',
- href: BillingController.index(),
- icon: CreditCard,
- },
- ];
-
- export function AppSidebar() {
- 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={overviewItems} />
- <NavStores />
- <NavMain items={accountItems} label="Account" />
- </SidebarContent>
-
- <SidebarFooter>
- <NavPlan />
- <NavUser />
- </SidebarFooter>
- </Sidebar>
- );
- }
|