"use client"; import { ChevronRight, File, Folder, FolderOpen } from "lucide-react"; import * as React from "react"; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarProvider, SidebarRail, SidebarTrigger, } from "@/components/ui/sidebar"; import { cn } from "@/lib/utils"; // Nav group with optional collapsible state type NavGroup = { title: string; items: Array<{ label: string; icon: React.ComponentType>; href: string; isActive?: boolean; children?: Array<{ label: string; icon: React.ComponentType>; href: string; isActive?: boolean; }>; }>; defaultOpen?: boolean; }; // 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?: { name: string; email: string; avatar: string; }; // 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/ShadcnBlocks-logo.svg", alt: "وندوک", title: "وندوک", description: "CRM فروش B2B", }, navGroups: [], footerGroup: { title: "پشتیبانی", items: [], }, }; // File tree data structure type FileTreeItem = { name: string; label: string; type: "file" | "folder"; children?: FileTreeItem[]; }; const fileTreeData: FileTreeItem[] = [ { name: "src", label: "فضای کاری", type: "folder", children: [ { name: "components", label: "ماژول‌ها", type: "folder", children: [ { name: "ui", label: "فروش", type: "folder", children: [ { name: "button.tsx", label: "داشبورد.tsx", type: "file" }, { name: "card.tsx", label: "مخاطبین.tsx", type: "file" }, { name: "dialog.tsx", label: "فرصت‌ها.tsx", type: "file" }, { name: "input.tsx", label: "فعالیت‌ها.tsx", type: "file" }, { name: "sidebar.tsx", label: "گزارش‌ها.tsx", type: "file" }, ], }, { name: "app-sidebar.tsx", label: "تنظیمات تیم.tsx", type: "file" }, { name: "nav-main.tsx", label: "منوی اصلی.tsx", type: "file" }, { name: "nav-user.tsx", label: "پروفایل کاربر.tsx", type: "file" }, ], }, { name: "lib", label: "کتابخانه داده", type: "folder", children: [{ name: "utils.ts", label: "ابزارها.ts", type: "file" }], }, { name: "app", label: "اپلیکیشن", type: "folder", children: [ { name: "layout.tsx", label: "چیدمان.tsx", type: "file" }, { name: "page.tsx", label: "صفحه.tsx", type: "file" }, { name: "globals.css", label: "تم سازمانی.css", type: "file" }, ], }, ], }, { name: "public", label: "عمومی", type: "folder", children: [ { name: "favicon.ico", label: "آیکن سایت.ico", type: "file" }, { name: "logo.svg", label: "لوگو.svg", type: "file" }, ], }, { name: "package.json", label: "پیکربندی بسته.json", type: "file" }, { name: "tsconfig.json", label: "پیکربندی.tsconfig.json", type: "file" }, { name: "tailwind.config.ts", label: "پیکربندی تم.ts", type: "file", }, { name: "README.md", label: "راهنما.md", type: "file" }, ]; const SidebarLogo = ({ logo }: { logo: SidebarData["logo"] }) => { return (
{logo.alt}
{logo.title} {logo.description}
); }; const FileTreeNode = ({ item, depth = 0, }: { item: FileTreeItem; depth?: number; }) => { const [isOpen, setIsOpen] = React.useState(depth < 2); if (item.type === "file") { return ( {item.label} ); } return ( {isOpen ? ( ) : ( )} {item.label} {item.children && ( {item.children.map((child) => ( ))} )} ); }; const AppSidebar = ({ ...props }: React.ComponentProps) => { return ( فایل‌ها {fileTreeData.map((item) => ( ))} ); }; interface Sidebar13Props { className?: string; } const Sidebar13 = ({ className }: Sidebar13Props) => { return (
ماژول‌ها فروش داشبورد.tsx
); }; export { Sidebar13 };