"use client"; import { BadgeCheck, BarChart3, Briefcase, ChevronRight, ClipboardList, Clock3, FileText, Folder, Globe2, HelpCircle, LayoutDashboard, Settings, Sparkles, Star, Users, } from "lucide-react"; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { Separator } from "@/components/ui/separator"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, } from "@/components/ui/sidebar"; import { cn } from "@/lib/utils"; type NavItem = { label: string; icon: React.ComponentType>; href: string; isActive?: boolean; children?: NavItem[]; }; type NavGroup = { title: string; items: NavItem[]; defaultOpen?: boolean; }; type SidebarData = { logo: { src: string; alt: string; title: string; description: string; }; navGroups: NavGroup[]; footerGroup: NavGroup; }; const sidebarData: SidebarData = { logo: { src: "/block-media/shadcnblocks/block/logos/ShadcnBlocks-logo.svg", alt: "فروش‌یار", title: "فروش‌یار", description: "داشبورد درآمد فروش", }, navGroups: [ { title: "نمای کلی", defaultOpen: true, items: [ { label: "داشبورد", icon: LayoutDashboard, href: "#", isActive: true, }, { label: "پیگیری‌ها", icon: ClipboardList, href: "#" }, { label: "پیش‌بینی فروش", icon: BarChart3, href: "#" }, ], }, { title: "فرصت‌ها", defaultOpen: true, items: [ { label: "فرصت‌های باز", icon: Briefcase, href: "#", children: [ { label: "فرصت سازمانی آفتاب", icon: FileText, href: "#" }, { label: "فرصت رشد مهتاب", icon: FileText, href: "#" }, { label: "فرصت پایلوت", icon: FileText, href: "#" }, ], }, { label: "بسته شده", icon: Folder, href: "#", children: [ { label: "بردهای ۱۴۰۳", icon: FileText, href: "#" }, { label: "بردهای ۱۴۰۲", icon: FileText, href: "#" }, ], }, ], }, { title: "تیم فروش", defaultOpen: false, items: [ { label: "نمایندگان", icon: Users, href: "#" }, { label: "اهداف ماهانه", icon: Clock3, href: "#" }, { label: "تأیید تخفیف", icon: BadgeCheck, href: "#" }, { label: "بازبینی پیش‌بینی", icon: Star, href: "#" }, ], }, { title: "فضای کار", defaultOpen: false, items: [ { label: "یکپارچه‌سازی‌ها", icon: Globe2, href: "#" }, { label: "اتوماسیون فروش", icon: Sparkles, href: "#" }, ], }, ], footerGroup: { title: "پشتیبانی", items: [ { label: "مرکز راهنما", icon: HelpCircle, href: "#" }, { label: "تنظیمات", icon: Settings, href: "#" }, ], }, }; const SidebarLogo = ({ logo }: { logo: SidebarData["logo"] }) => { return (
{logo.alt}
{logo.title} {logo.description}
); }; const NavMenuItem = ({ item }: { item: NavItem }) => { const Icon = item.icon; const hasChildren = item.children && item.children.length > 0; if (!hasChildren) { return ( {item.label} ); } return ( {item.label} {item.children!.map((child) => ( {child.label} ))} ); }; const AppSidebar = ({ ...props }: React.ComponentProps) => { return ( {sidebarData.navGroups.map((group) => ( {group.title} {group.items.map((item) => ( ))} ))} {sidebarData.footerGroup.title} {sidebarData.footerGroup.items.map((item) => ( ))} ); }; interface Sidebar2Props { className?: string; } const Sidebar2 = ({ className }: Sidebar2Props) => { return (
نمای کلی داشبورد
); }; export { Sidebar2 };