"use client"; import { Check, ChevronRight, ChevronsUpDown, LogOut, Search, User, X, } from "lucide-react"; import * as React from "react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Label } from "@/components/ui/label"; import { Separator } from "@/components/ui/separator"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, 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; }; // User data for footer (Sidebar6+) type UserData = { name: string; email: string; avatar: string; }; // Workspace data for switcher (Sidebar7+) type Workspace = { id: string; name: string; logo: string; plan: 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?: Workspace[]; // 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: "اتوماسیون بازاریابی", }, navGroups: [], footerGroup: { title: "پشتیبانی", items: [], }, user: { name: "علی رضایی", email: "ali@example.com", avatar: "/block-media/shadcnblocks/block/avatar-5.webp", }, workspaces: [ { id: "1", name: "ShadcnBlocks", logo: "/block-media/shadcnblocks/block/logos/ShadcnBlocks-logo.svg", plan: "سازمانی", }, { id: "2", name: "قالب‌های کمپین", logo: "/block-media/shadcnblocks/block/logos/ShadcnBlocks-logo.svg", plan: "تیم رشد", }, { id: "3", name: "بلوک‌های ایمیل", logo: "/block-media/shadcnblocks/block/logos/ShadcnBlocks-logo.svg", plan: "آزمایشی", }, ], activeWorkspace: "1", }; // Helper to get active workspace const getActiveWorkspace = (data: SidebarData): Workspace | undefined => { return data.workspaces?.find((w) => w.id === data.activeWorkspace); }; // AWS-style mega menu data - extensive service catalog const megaMenuCategories = [ { id: "compute", title: "کمپین‌ها", sections: [ { title: "ایمیل", items: [ "EC2 Instances", "Spot Instances", "Reserved Instances", "Dedicated Hosts", "Capacity Reservations", ], }, { title: "SMS و اعلان", items: [ "ECS", "EKS", "Fargate", "ECR", "App Runner", "Red Hat OpenShift", ], }, { title: "پوش نوتیفیکیشن", items: [ "Lambda", "Lambda@Edge", "Step Functions", "EventBridge", "SQS", "SNS", ], }, { title: "چندکاناله", items: ["Outposts", "Wavelength", "Local Zones", "Snow Family"], }, ], }, { id: "storage", title: "مخاطبین", sections: [ { title: "لیست‌ها", items: [ "S3 Standard", "S3 Intelligent-Tiering", "S3 Glacier", "S3 Glacier Deep Archive", "S3 Access Points", ], }, { title: "سگمنت‌ها", items: [ "EBS Volumes", "EBS Snapshots", "Instance Store", "FSx for NetApp", ], }, { title: "فیلدهای سفارشی", items: ["EFS", "FSx for Windows", "FSx for Lustre", "FSx for OpenZFS"], }, { title: "درون‌ریزی داده", items: [ "DataSync", "Transfer Family", "Snow Family", "Storage Gateway", ], }, ], }, { id: "database", title: "امتیازدهی لید", sections: [ { title: "رفتار کاربر", items: [ "RDS for PostgreSQL", "RDS for MySQL", "RDS for MariaDB", "RDS for Oracle", "RDS for SQL Server", "Aurora PostgreSQL", "Aurora MySQL", "Aurora Serverless", ], }, { title: "ویژگی‌های حساب", items: [ "DynamoDB", "DynamoDB Accelerator", "ElastiCache Redis", "ElastiCache Memcached", "MemoryDB", ], }, { title: "رویدادها", items: ["DocumentDB", "MongoDB Compatible"], }, { title: "سایر سیگنال‌ها", items: [ "Neptune", "Timestream", "QLDB", "Keyspaces", "Redshift", "Redshift Serverless", ], }, ], }, { id: "networking", title: "یکپارچه‌سازی‌ها", sections: [ { title: "سامانه مدیریت ارتباط با مشتری", items: [ "VPC", "Subnets", "Route Tables", "Internet Gateway", "NAT Gateway", "Elastic IPs", ], }, { title: "وب‌هوک", items: [ "Direct Connect", "Site-to-Site VPN", "Client VPN", "Transit Gateway", "PrivateLink", ], }, { title: "آنالیتیکس", items: ["Route 53", "CloudFront", "Global Accelerator"], }, { title: "دسترسی‌ها", items: [ "Security Groups", "Network ACLs", "WAF", "Shield", "Firewall Manager", ], }, ], }, { id: "security", title: "حریم خصوصی", sections: [ { title: "رضایت‌نامه", items: [ "IAM", "IAM Identity Center", "Organizations", "Resource Access Manager", "Directory Service", ], }, { title: "تشخیص اسپم", items: ["GuardDuty", "Inspector", "Macie", "Security Hub", "Detective"], }, { title: "لیست لغو اشتراک", items: ["WAF", "Shield", "Firewall Manager", "Network Firewall"], }, { title: "انطباق GDPR", items: ["Audit Manager", "Artifact", "Config", "CloudTrail"], }, { title: "رمزنگاری داده", items: [ "KMS", "CloudHSM", "Certificate Manager", "Secrets Manager", "Private CA", ], }, ], }, { id: "analytics", title: "گزارش‌ها", sections: [ { title: "داشبورد کمپین", items: ["Lake Formation", "Glue", "Glue DataBrew", "Data Exchange"], }, { title: "Attribution", items: ["Athena", "Redshift", "OpenSearch", "QuickSight"], }, { title: "گزارش زنده", items: [ "Kinesis Data Streams", "Kinesis Firehose", "Kinesis Analytics", "MSK", "MSK Serverless", ], }, { title: "کوهورت", items: ["EMR", "EMR Serverless", "EMR on EKS"], }, ], }, { id: "ml", title: "هوش مصنوعی", sections: [ { title: "پیشنهاد ارسال", items: [ "SageMaker Studio", "SageMaker Notebooks", "SageMaker Training", "SageMaker Inference", "SageMaker Pipelines", ], }, { title: "تولید محتوا", items: [ "Bedrock", "Rekognition", "Textract", "Comprehend", "Translate", "Polly", "Transcribe", "Lex", ], }, { title: "امتیازدهی هوشمند", items: ["Deep Learning AMIs", "Deep Learning Containers", "Neuron"], }, ], }, { id: "devtools", title: "ابزار تیم", sections: [ { title: "CI/CD", items: [ "CodeCommit", "CodeBuild", "CodeDeploy", "CodePipeline", "CodeArtifact", ], }, { title: "سازنده جریان", items: [ "Cloud9", "CodeStar", "X-Ray", "CodeGuru", "Fault Injection Simulator", ], }, { title: "API و SDK", items: ["CLI", "CloudShell", "SDKs", "CDK", "SAM", "Amplify"], }, ], }, { id: "management", title: "مدیریت تیم", sections: [ { title: "پایش تحویل", items: [ "CloudWatch Metrics", "CloudWatch Logs", "CloudWatch Alarms", "CloudWatch Dashboards", "CloudWatch Synthetics", "CloudWatch RUM", ], }, { title: "حاکمیت برند", items: [ "Organizations", "Control Tower", "Service Catalog", "Systems Manager", "Trusted Advisor", ], }, { title: "زیرساخت ارسال", items: ["CloudFormation", "OpsWorks", "App Config", "Launch Wizard"], }, { title: "مدیریت تیم بودجه", items: [ "Cost Explorer", "Budgets", "Cost & Usage Report", "Savings Plans", "Reserved Instance Reporting", ], }, ], }, { id: "integration", title: "اتوماسیون", sections: [ { title: "صف پیام", items: ["SQS", "SNS", "MQ", "EventBridge", "EventBridge Scheduler"], }, { title: "جریان پرورش", items: [ "Step Functions", "AppFlow", "Managed Workflows for Apache Airflow", ], }, { title: "وب‌هوک‌های API", items: ["API Gateway", "AppSync", "Location Service"], }, ], }, ]; const WorkspaceSwitcher = ({ workspaces, activeWorkspace, }: { workspaces: Workspace[]; activeWorkspace: Workspace; }) => { const [selected, setSelected] = React.useState(activeWorkspace); return (
{selected.name}
{selected.name} {selected.plan}
فضاهای کاری {workspaces.map((workspace) => ( setSelected(workspace)} className="gap-2 p-2" >
{workspace.name}
{workspace.name} {workspace.id === selected.id && ( )}
))}
); }; const SearchForm = () => { return (
); }; // Full-screen mega menu panel component (AWS-style) const MegaMenuPanel = ({ category, onClose, }: { category: (typeof megaMenuCategories)[0]; onClose: () => void; }) => { return (
{/* Header */}

{category.title}

{/* Content - scrollable grid of sections */}
{category.sections.map((section) => (

{section.title}

    {section.items.map((item) => (
  • {item}
  • ))}
))}
); }; // Category nav item const CategoryItem = ({ category, isSelected, onClick, }: { category: (typeof megaMenuCategories)[0]; isSelected: boolean; onClick: () => void; }) => { return ( {category.title} ); }; const NavUser = ({ user }: { user: UserData }) => { return ( {user.name .split(" ") .map((n) => n[0]) .join("")}
{user.name} {user.email}
{user.name .split(" ") .map((n) => n[0]) .join("")}
{user.name} {user.email}
حساب کاربری خروج
); }; const AppSidebar = ({ ...props }: React.ComponentProps) => { const activeWorkspace = getActiveWorkspace(sidebarData); const [selectedCategory, setSelectedCategory] = React.useState< (typeof megaMenuCategories)[0] | null >(null); const handleCategoryClick = (category: (typeof megaMenuCategories)[0]) => { setSelectedCategory(selectedCategory?.id === category.id ? null : category); }; return ( {sidebarData.workspaces && activeWorkspace && ( )} ماژول‌ها {megaMenuCategories.map((category) => ( handleCategoryClick(category)} /> ))} {sidebarData.user && } {selectedCategory && ( setSelectedCategory(null)} /> )} ); }; interface Sidebar16Props { className?: string; } const Sidebar16 = ({ className }: Sidebar16Props) => { return (
نمای کلی داشبورد
); }; export { Sidebar16 };