"use client"; import { BadgeCheck, BarChart3, Briefcase, ChevronDown, ChevronsUpDown, ClipboardList, Clock3, FileText, Folder, Globe2, HelpCircle, LayoutDashboard, LogOut, Menu, Search, Settings, Sparkles, Star, User, Users, } from "lucide-react"; import * as React from "react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; import { cn } from "@/lib/utils"; // Base nav item - used by simple sidebars type NavItem = { label: string; icon: React.ComponentType>; href: string; isActive?: boolean; // Optional children for submenus (Sidebar3+) children?: NavItem[]; }; // Nav group with optional collapsible state type NavGroup = { title: string; items: NavItem[]; // Optional: default collapsed state (Sidebar2+) defaultOpen?: boolean; }; // User data for footer (Sidebar6+) type UserData = { name: string; email: string; avatar: string; }; // Complete sidebar data structure type SidebarData = { // Logo/branding (all sidebars) logo: { src: string; alt: string; title: string; description: string; }; // Main navigation groups (all sidebars) navGroups: NavGroup[]; // Footer navigation group (all sidebars) footerGroup: NavGroup; // User data for user footer (Sidebar6+) user?: UserData; // Workspaces for switcher (Sidebar7+) workspaces?: Array<{ id: string; name: string; logo: string; plan: string; }>; // Currently active workspace (Sidebar7+) activeWorkspace?: string; }; // Shared sidebar data - works with all sidebar variations const sidebarData: SidebarData = { logo: { src: "/block-media/shadcnblocks/block/logos/NovaSales-logo.svg", alt: "شاد‌سی‌ان بلاکس", title: "NovaSales", 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: "#" }, ], }, user: { name: "علی رضایی", email: "ali@example.com", avatar: "/block-media/shadcnblocks/block/avatar-5.webp", }, workspaces: [ { id: "1", name: "NovaSales", logo: "/block-media/shadcnblocks/block/logos/NovaSales-logo.svg", plan: "سازمانی", }, { id: "2", name: "ری یو آی قالب‌ها", logo: "/block-media/shadcnblocks/block/logos/NovaSales-logo.svg", plan: "استارتاپ", }, { id: "3", name: "ری یو آی بخش‌ها", logo: "/block-media/shadcnblocks/block/logos/NovaSales-logo.svg", plan: "رایگان", }, ], activeWorkspace: "1", }; // Desktop navigation dropdown for each group const NavDropdown = ({ group }: { group: NavGroup }) => { return ( {group.items.map((item) => { const Icon = item.icon; return ( {item.label} {item.children?.map((child) => { const ChildIcon = child.icon; return ( {child.label} ); })} ); })} ); }; // Mobile navigation sheet const MobileNav = () => { return (
{sidebarData.logo.alt}
{sidebarData.logo.title}
); }; // User dropdown const NavUser = ({ user }: { user: UserData }) => { return (

{user.name}

{user.email}

حساب کاربری خروج
); }; interface ApplicationShell3Props { className?: string; } export function ApplicationShell3({ className }: ApplicationShell3Props) { return (
{/* Top navigation bar */}
{/* Mobile menu */} {/* Logo */}
{sidebarData.logo.alt}
{sidebarData.logo.title}
{/* Desktop navigation */} {/* Right side */}
{sidebarData.user && }
{/* Main content */}
); }