'use client'; import * as React from 'react'; import { LayoutDashboard, Plus, Layers, Package, Milestone, ShieldCheck, Users } from 'lucide-react'; import { NavUser } from '@/components/nav-user'; import { ROUTES } from '@/utils/routes'; import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarGroup, SidebarGroupLabel, } from '@/components/ui/sidebar'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useAppStore } from '@/store/app.store'; // This is the navigation data const data = { navMain: [ { title: 'Dashboard', url: ROUTES.DASHBOARD, icon: LayoutDashboard, }, { title: 'New Analysis', url: ROUTES.UPLOAD, icon: Plus, }, { title: 'Project', url: ROUTES.PROJECT, icon: Layers, }, { title: 'Package', url: ROUTES.PACKAGE, icon: Package, }, { title: 'Segment', url: ROUTES.CHAINAGE, icon: Milestone, }, { title: 'Roles', url: ROUTES.ROLES, icon: ShieldCheck, }, { title: 'Users', url: ROUTES.USERS, icon: Users, }, ], }; export function AppSidebar({ ...props }: React.ComponentProps) { const pathname = usePathname(); const authUser = useAppStore((state) => state.user); const user = { name: [authUser?.first_name, authUser?.last_name].filter(Boolean).join(' ') || 'Admin', email: authUser?.email || '', avatar: authUser?.profile_photo_url || '/avatars/profile.jpg', }; return (
Vision Road Analytics Platform
{data.navMain.map((item) => ( {item.icon && } {item.title} ))}
); }