| "use client" |
|
|
| import type * as React from "react" |
| import Link from "next/link" |
| import { |
| Package, |
| Users, |
| MessageSquare, |
| Brain, |
| BarChart3, |
| Calculator, |
| Home, |
| Scan, |
| AlertTriangle, |
| TrendingUp, |
| FileCheck, |
| } from "lucide-react" |
|
|
| import { |
| Sidebar, |
| SidebarContent, |
| SidebarGroup, |
| SidebarGroupContent, |
| SidebarHeader, |
| SidebarMenu, |
| SidebarMenuButton, |
| SidebarMenuItem, |
| SidebarRail, |
| } from "@/components/ui/sidebar" |
|
|
| const data = { |
| navMain: [ |
| { |
| title: "Dashboard", |
| url: "/", |
| icon: Home, |
| }, |
| { |
| title: "Inventory", |
| icon: Package, |
| items: [ |
| { |
| title: "Products", |
| url: "/inventory", |
| icon: Package, |
| }, |
| { |
| title: "Barcode Scanner", |
| url: "/inventory/scanner", |
| icon: Scan, |
| }, |
| { |
| title: "Alerts", |
| url: "/inventory/alerts", |
| icon: AlertTriangle, |
| }, |
| ], |
| }, |
| { |
| title: "Customers", |
| url: "/customers", |
| icon: Users, |
| }, |
| { |
| title: "WhatsApp", |
| url: "/whatsapp", |
| icon: MessageSquare, |
| }, |
| { |
| title: "Quotations", |
| url: "/quotations", |
| icon: FileCheck, |
| }, |
| { |
| title: "AI Analytics", |
| url: "/analytics", |
| icon: Brain, |
| }, |
| { |
| title: "Reports", |
| url: "/reports", |
| icon: BarChart3, |
| }, |
| { |
| title: "Finance", |
| url: "/finance", |
| icon: Calculator, |
| }, |
| ], |
| } |
|
|
| export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) { |
| return ( |
| <Sidebar variant="inset" {...props}> |
| <SidebarHeader> |
| <div className="flex items-center gap-2 px-4 py-2"> |
| <div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary text-primary-foreground"> |
| <TrendingUp className="h-4 w-4" /> |
| </div> |
| <div className="grid flex-1 text-left text-sm leading-tight"> |
| <span className="truncate font-semibold">SETA Smart</span> |
| <span className="truncate text-xs">Inventory</span> |
| </div> |
| </div> |
| </SidebarHeader> |
| <SidebarContent> |
| <SidebarGroup> |
| <SidebarGroupContent> |
| <SidebarMenu> |
| {data.navMain.map((item) => ( |
| <SidebarMenuItem key={item.title}> |
| {item.items ? ( |
| <div> |
| <SidebarMenuButton> |
| <item.icon /> |
| <span>{item.title}</span> |
| </SidebarMenuButton> |
| <SidebarMenu className="ml-4"> |
| {item.items.map((subItem) => ( |
| <SidebarMenuItem key={subItem.title}> |
| <SidebarMenuButton asChild> |
| <Link href={subItem.url}> |
| <subItem.icon /> |
| <span>{subItem.title}</span> |
| </Link> |
| </SidebarMenuButton> |
| </SidebarMenuItem> |
| ))} |
| </SidebarMenu> |
| </div> |
| ) : ( |
| <SidebarMenuButton asChild> |
| <Link href={item.url}> |
| <item.icon /> |
| <span>{item.title}</span> |
| </Link> |
| </SidebarMenuButton> |
| )} |
| </SidebarMenuItem> |
| ))} |
| </SidebarMenu> |
| </SidebarGroupContent> |
| </SidebarGroup> |
| </SidebarContent> |
| <SidebarRail /> |
| </Sidebar> |
| ) |
| } |
|
|