"use client" import * as React from "react" import { BadgeCheck, Bell, BookOpen, Bot, ChevronRight, ChevronsUpDown, CreditCard, Folder, Forward, Frame, GalleryVerticalEnd, LogOut, Map, MoreHorizontal, PieChart, Settings2, Sparkles, SquareTerminal, Trash2, } from "lucide-react" import { LanguageProvider, LanguageSelector, useTranslation, type Translations, } from "@/components/language-selector" import { Avatar, AvatarFallback, AvatarImage, } from "@/styles/base-nova/ui-rtl/avatar" import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/styles/base-nova/ui-rtl/collapsible" import { DirectionProvider } from "@/styles/base-nova/ui-rtl/direction" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/styles/base-nova/ui-rtl/dropdown-menu" import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, } from "@/styles/base-nova/ui-rtl/sidebar" const translations: Translations = { en: { dir: "ltr", values: { teamName: "Acme Inc", teamPlan: "Enterprise", platform: "Platform", projects: "Projects", viewProject: "View Project", shareProject: "Share Project", deleteProject: "Delete Project", more: "More", upgradeToPro: "Upgrade to Pro", account: "Account", billing: "Billing", notifications: "Notifications", logOut: "Log out", playground: "Playground", history: "History", starred: "Starred", settings: "Settings", models: "Models", genesis: "Genesis", explorer: "Explorer", quantum: "Quantum", documentation: "Documentation", introduction: "Introduction", getStarted: "Get Started", tutorials: "Tutorials", changelog: "Changelog", general: "General", team: "Team", limits: "Limits", designEngineering: "Design Engineering", salesMarketing: "Sales & Marketing", travel: "Travel", }, }, ar: { dir: "rtl", values: { teamName: "شركة أكمي", teamPlan: "المؤسسة", platform: "المنصة", projects: "المشاريع", viewProject: "عرض المشروع", shareProject: "مشاركة المشروع", deleteProject: "حذف المشروع", more: "المزيد", upgradeToPro: "ترقية إلى Pro", account: "الحساب", billing: "الفوترة", notifications: "الإشعارات", logOut: "تسجيل الخروج", playground: "ملعب", history: "السجل", starred: "المميز", settings: "الإعدادات", models: "النماذج", genesis: "جينيسيس", explorer: "إكسبلورر", quantum: "كوانتوم", documentation: "التوثيق", introduction: "مقدمة", getStarted: "ابدأ", tutorials: "الدروس", changelog: "سجل التغييرات", general: "عام", team: "الفريق", limits: "الحدود", designEngineering: "هندسة التصميم", salesMarketing: "المبيعات والتسويق", travel: "السفر", }, }, he: { dir: "rtl", values: { teamName: "אקמי בע״מ", teamPlan: "ארגוני", platform: "פלטפורמה", projects: "פרויקטים", viewProject: "הצג פרויקט", shareProject: "שתף פרויקט", deleteProject: "מחק פרויקט", more: "עוד", upgradeToPro: "שדרג ל-Pro", account: "חשבון", billing: "חיוב", notifications: "התראות", logOut: "התנתק", playground: "מגרש משחקים", history: "היסטוריה", starred: "מועדפים", settings: "הגדרות", models: "מודלים", genesis: "ג'נסיס", explorer: "אקספלורר", quantum: "קוונטום", documentation: "תיעוד", introduction: "מבוא", getStarted: "התחל", tutorials: "מדריכים", changelog: "יומן שינויים", general: "כללי", team: "צוות", limits: "מגבלות", designEngineering: "הנדסת עיצוב", salesMarketing: "מכירות ושיווק", travel: "נסיעות", }, }, } export function SidebarRtl() { return ( ) } function AppSidebarWithProvider() { const { language, setLanguage, dir } = useTranslation(translations, "ar") return (
) } function AppSidebar() { const { dir, t } = useTranslation(translations, "ar") const navMain = [ { title: t.playground, url: "#", icon: SquareTerminal, isActive: true, items: [ { title: t.history, url: "#" }, { title: t.starred, url: "#" }, { title: t.settings, url: "#" }, ], }, { title: t.models, url: "#", icon: Bot, items: [ { title: t.genesis, url: "#" }, { title: t.explorer, url: "#" }, { title: t.quantum, url: "#" }, ], }, { title: t.documentation, url: "#", icon: BookOpen, items: [ { title: t.introduction, url: "#" }, { title: t.getStarted, url: "#" }, { title: t.tutorials, url: "#" }, { title: t.changelog, url: "#" }, ], }, { title: t.settings, url: "#", icon: Settings2, items: [ { title: t.general, url: "#" }, { title: t.team, url: "#" }, { title: t.billing, url: "#" }, { title: t.limits, url: "#" }, ], }, ] const projects = [ { name: t.designEngineering, url: "#", icon: Frame }, { name: t.salesMarketing, url: "#", icon: PieChart }, { name: t.travel, url: "#", icon: Map }, ] const user = { name: "shadcn", email: "m@example.com", avatar: "/avatars/shadcn.jpg", } return ( ) } function SidebarContentInner({ dir, t, navMain, projects, user, }: { dir: "ltr" | "rtl" t: typeof translations.ar.values navMain: Array<{ title: string url: string icon?: React.ElementType isActive?: boolean items?: Array<{ title: string; url: string }> }> projects: Array<{ name: string url: string icon: React.ElementType }> user: { name: string email: string avatar: string } }) { const { isMobile } = useSidebar() return ( <> }>
{t.teamName} {t.teamPlan}
{t.platform} {navMain.map((item) => ( } > {item.icon && } {item.title} {item.items?.map((subItem) => ( } > {subItem.title} ))} ))} {t.projects} {projects.map((item) => ( }> {item.name} } > {t.more} {t.viewProject} {t.shareProject} {t.deleteProject} ))} {t.more} } > CN
{user.name} {user.email}
CN
{user.name} {user.email}
{t.upgradeToPro} {t.account} {t.billing} {t.notifications} {t.logOut}
) }