"use client"; import { ArrowDownRight, ArrowUpRight, BarChart3, Bell, Banknote, Box, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, ChevronsUpDown, CircleDollarSign, ClipboardList, Copy, Eye, Filter, Globe, HelpCircle, LayoutDashboard, LayoutGrid, LineChart, LogOut, MessageSquare, MoreHorizontal, Package, Pencil, RotateCcw, Search, Settings, Truck, User, Users, X, } from "lucide-react"; import * as React from "react"; import type { TooltipProps } from "recharts"; import { Bar, BarChart, CartesianGrid, Tooltip, XAxis, YAxis } from "recharts"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { type ChartConfig, ChartContainer } from "@/components/ui/chart"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, } from "@/components/ui/sidebar"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Tooltip as ShadTooltip, TooltipContent as ShadTooltipContent, TooltipProvider as ShadTooltipProvider, TooltipTrigger as ShadTooltipTrigger, } from "@/components/ui/tooltip"; 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 UserData = { name: string; email: string; avatar: string; }; type SidebarData = { logo: { src: string; alt: string; title: string; description: string; }; navGroups: NavGroup[]; footerGroup: NavGroup; user?: UserData; }; type StatItem = { title: string; previousValue: number; value: number; changePercent: number; isPositive: boolean; icon: React.ComponentType>; format: "currency" | "number"; }; type Segment = { name: string; value: number; color: string; }; type CategoryBreakdownRow = { name: string; orderCount: number; changePercent: number; isPositive: boolean; }; type OrderStatus = "Processing" | "Shipped" | "Delivered" | "Cancelled"; type Order = { id: string; orderNumber: string; customer: string; customerInitials: string; category: string; products: string[]; productCount: number; status: OrderStatus; total: number; date: string; }; const currencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", minimumFractionDigits: 0, maximumFractionDigits: 0, }); const numberFormatter = new Intl.NumberFormat("fa-IR"); const compactCurrencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", notation: "compact", maximumFractionDigits: 0, }); const monthLabel = (monthIndex: number) => new Intl.DateTimeFormat("fa-IR", { month: "short" }).format( new Date(2025, monthIndex, 1), ); const orderStatusLabels: Record = { Processing: "در حال پردازش", Shipped: "ارسال‌شده", Delivered: "تحویل‌شده", Cancelled: "لغوشده", }; const categoryLabels: Record = { "Computers & tablets": "رایانه و تبلت", Mobile: "موبایل", "Wearables & audio": "پوشیدنی و صوتی", "Home & TV": "خانه و تلویزیون", }; const formatOrderDate = (dateStr: string) => { const parsed = new Date(dateStr); if (Number.isNaN(parsed.getTime())) return dateStr; return new Intl.DateTimeFormat("fa-IR", { year: "numeric", month: "short", day: "numeric", }).format(parsed); }; /** * Custom hook for hover highlight interaction. * Provides stable callback to prevent unnecessary re-renders in chart components. */ function useHoverHighlight() { const [active, setActive] = React.useState(null); const handleHover = React.useCallback((value: T | null) => { setActive(value); }, []); return { active, handleHover }; } const mixBase = "var(--background)"; const palette = { primary: "var(--primary)", secondary: { light: `color-mix(in oklch, var(--primary) 75%, ${mixBase})`, dark: `color-mix(in oklch, var(--primary) 85%, ${mixBase})`, }, tertiary: { light: `color-mix(in oklch, var(--primary) 55%, ${mixBase})`, dark: `color-mix(in oklch, var(--primary) 65%, ${mixBase})`, }, quaternary: { light: `color-mix(in oklch, var(--primary) 40%, ${mixBase})`, dark: `color-mix(in oklch, var(--primary) 45%, ${mixBase})`, }, }; const sidebarData: SidebarData = { logo: { src: "/block-media/shadcnblocks/block/logos/NovaSales-logo.svg", alt: "فروشگاه آکمه", title: "ری یو آی Store", description: "فروشگاه آنلاین", }, navGroups: [ { title: "اصلی", defaultOpen: true, items: [ { label: "داشبورد", icon: LayoutDashboard, href: "#", isActive: true, }, { label: "سفارش‌ها", icon: ClipboardList, href: "#" }, { label: "مرجوعی‌ها", icon: RotateCcw, href: "#" }, ], }, { title: "کاتالوگ", defaultOpen: true, items: [ { label: "محصولات", icon: Box, href: "#", children: [ { label: "همه محصولات", icon: Package, href: "#" }, { label: "دسته‌بندی‌ها", icon: Package, href: "#" }, { label: "موجودی", icon: Package, href: "#" }, ], }, { label: "ارسال", icon: Truck, href: "#" }, ], }, { title: "مشتریان", defaultOpen: false, items: [ { label: "همه مشتریان", icon: Users, href: "#" }, { label: "پیام‌ها", icon: MessageSquare, href: "#" }, ], }, { title: "تحلیل فروش", defaultOpen: false, items: [ { label: "نمای کلی", icon: Globe, href: "#" }, { label: "گزارش‌ها", icon: BarChart3, href: "#" }, { label: "فروش", icon: LineChart, href: "#" }, ], }, ], footerGroup: { title: "تنظیمات", items: [{ label: "تنظیمات", icon: Settings, href: "#" }], }, user: { name: "علی رضایی", email: "john@acme.store", avatar: "/block-media/shadcnblocks/block/avatar-8.webp", }, }; const statsData: StatItem[] = [ { title: "فروش ناخالص (ماه جاری)", previousValue: 148230, value: 189541, changePercent: 27.9, isPositive: true, icon: CircleDollarSign, format: "currency", }, { title: "سفارش‌های تکمیل‌شده", previousValue: 18452, value: 21847, changePercent: 18.4, isPositive: true, icon: ClipboardList, format: "number", }, { title: "مشتریان جدید", previousValue: 4120, value: 4975, changePercent: 20.8, isPositive: true, icon: Users, format: "number", }, { title: "مبلغ بازپرداخت", previousValue: 9821, value: 8473, changePercent: 13.7, isPositive: false, icon: Banknote, format: "currency", }, ]; const segments: Segment[] = [ { name: "رایانه و تبلت", value: 78000, color: palette.primary }, { name: "موبایل", value: 52000, color: palette.secondary.light }, { name: "پوشیدنی و صوتی", value: 35000, color: palette.tertiary.light }, { name: "خانه و تلویزیون", value: 24541, color: palette.quaternary.light }, ]; const categoryBreakdown: CategoryBreakdownRow[] = [ { name: "رایانه و تبلت", orderCount: 8420, changePercent: 14.2, isPositive: true, }, { name: "موبایل", orderCount: 5340, changePercent: 19.1, isPositive: true }, { name: "پوشیدنی و صوتی", orderCount: 2980, changePercent: 7.4, isPositive: true, }, { name: "خانه و تلویزیون", orderCount: 1240, changePercent: 4.2, isPositive: false, }, ]; const fullYearData = [ { month: monthLabel(0), thisYear: 42000, prevYear: 38000 }, { month: monthLabel(1), thisYear: 38000, prevYear: 45000 }, { month: monthLabel(2), thisYear: 52000, prevYear: 41000 }, { month: monthLabel(3), thisYear: 45000, prevYear: 48000 }, { month: monthLabel(4), thisYear: 58000, prevYear: 44000 }, { month: monthLabel(5), thisYear: 41000, prevYear: 52000 }, { month: monthLabel(6), thisYear: 55000, prevYear: 47000 }, { month: monthLabel(7), thisYear: 48000, prevYear: 53000 }, { month: monthLabel(8), thisYear: 62000, prevYear: 49000 }, { month: monthLabel(9), thisYear: 54000, prevYear: 58000 }, { month: monthLabel(10), thisYear: 67000, prevYear: 52000 }, { month: monthLabel(11), thisYear: 71000, prevYear: 61000 }, ]; type TimePeriod = "6months" | "year"; const periodLabels: Record = { "6months": "۶ ماه اخیر", year: "۱۲ ماه", }; function getDataForPeriod(period: TimePeriod) { if (period === "6months") { return fullYearData.slice(0, 6); } return fullYearData; } const orderStatuses: OrderStatus[] = [ "Processing", "Shipped", "Delivered", "Cancelled", ]; const orders: Order[] = [ { id: "1", orderNumber: "ORD-2024-001", customer: "Sarah Johnson", customerInitials: "SJ", category: "Computers & tablets", products: ["MacBook Pro 14", "Magic Mouse"], productCount: 2, status: "Delivered", total: 2499.0, date: "Jan 28, 2024", }, { id: "2", orderNumber: "ORD-2024-002", customer: "Michael Chen", customerInitials: "MC", category: "Mobile", products: ["iPhone 15 Pro", "AirPods Pro"], productCount: 2, status: "Shipped", total: 1348.0, date: "Jan 27, 2024", }, { id: "3", orderNumber: "ORD-2024-003", customer: "Emma Wilson", customerInitials: "EW", category: "Computers & tablets", products: ["iPad Air", "Apple Pencil", "Smart Keyboard"], productCount: 3, status: "Processing", total: 1198.0, date: "Jan 27, 2024", }, { id: "4", orderNumber: "ORD-2024-004", customer: "James Rodriguez", customerInitials: "JR", category: "Wearables & audio", products: ["Apple Watch Ultra"], productCount: 1, status: "Delivered", total: 799.0, date: "Jan 26, 2024", }, { id: "5", orderNumber: "ORD-2024-005", customer: "Lisa Park", customerInitials: "LP", category: "Computers & tablets", products: ["Mac Mini M2"], productCount: 1, status: "Cancelled", total: 599.0, date: "Jan 26, 2024", }, { id: "6", orderNumber: "ORD-2024-006", customer: "David Kim", customerInitials: "DK", category: "Computers & tablets", products: ["Studio Display", "Mac Studio"], productCount: 2, status: "Shipped", total: 5498.0, date: "Jan 25, 2024", }, { id: "7", orderNumber: "ORD-2024-007", customer: "Anna Martinez", customerInitials: "AM", category: "Computers & tablets", products: ["MacBook Air M2"], productCount: 1, status: "Delivered", total: 1199.0, date: "Jan 25, 2024", }, { id: "8", orderNumber: "ORD-2024-008", customer: "Robert Taylor", customerInitials: "RT", category: "Mobile", products: ["iPhone 15", "MagSafe Charger"], productCount: 2, status: "Processing", total: 878.0, date: "Jan 24, 2024", }, { id: "9", orderNumber: "ORD-2024-009", customer: "Jennifer Lee", customerInitials: "JL", category: "Wearables & audio", products: ["AirPods Max"], productCount: 1, status: "Shipped", total: 549.0, date: "Jan 24, 2024", }, { id: "10", orderNumber: "ORD-2024-010", customer: "William Brown", customerInitials: "WB", category: "Computers & tablets", products: ["iPad Pro 12.9", "Magic Keyboard"], productCount: 2, status: "Delivered", total: 1648.0, date: "Jan 23, 2024", }, { id: "11", orderNumber: "ORD-2024-011", customer: "Sophia Davis", customerInitials: "SD", category: "Computers & tablets", products: ["MacBook Pro 16"], productCount: 1, status: "Processing", total: 2499.0, date: "Jan 23, 2024", }, { id: "12", orderNumber: "ORD-2024-012", customer: "Daniel Garcia", customerInitials: "DG", category: "Home & TV", products: ["Apple TV 4K", "HomePod mini"], productCount: 2, status: "Cancelled", total: 278.0, date: "Jan 22, 2024", }, { id: "13", orderNumber: "ORD-2024-013", customer: "Olivia White", customerInitials: "OW", category: "Mobile", products: ["iPhone 15 Pro Max"], productCount: 1, status: "Delivered", total: 1199.0, date: "Jan 22, 2024", }, { id: "14", orderNumber: "ORD-2024-014", customer: "Thomas Anderson", customerInitials: "TA", category: "Computers & tablets", products: ["Mac Pro", "Pro Display XDR"], productCount: 2, status: "Shipped", total: 12498.0, date: "Jan 21, 2024", }, { id: "15", orderNumber: "ORD-2024-015", customer: "Emily Thompson", customerInitials: "ET", category: "Computers & tablets", products: ["iPad mini", "Apple Pencil"], productCount: 2, status: "Delivered", total: 648.0, date: "Jan 21, 2024", }, { id: "16", orderNumber: "ORD-2024-016", customer: "Christopher Moore", customerInitials: "CM", category: "Wearables & audio", products: ["AirPods Pro 2"], productCount: 1, status: "Processing", total: 249.0, date: "Jan 20, 2024", }, { id: "17", orderNumber: "ORD-2024-017", customer: "Isabella Jackson", customerInitials: "IJ", category: "Wearables & audio", products: ["Apple Watch Series 9"], productCount: 1, status: "Shipped", total: 399.0, date: "Jan 20, 2024", }, { id: "18", orderNumber: "ORD-2024-018", customer: "Matthew Harris", customerInitials: "MH", category: "Computers & tablets", products: ["MacBook Air 15"], productCount: 1, status: "Delivered", total: 1299.0, date: "Jan 19, 2024", }, { id: "19", orderNumber: "ORD-2024-019", customer: "Ava Clark", customerInitials: "AC", category: "Mobile", products: ["iPhone SE", "EarPods"], productCount: 2, status: "Cancelled", total: 448.0, date: "Jan 19, 2024", }, { id: "20", orderNumber: "ORD-2024-020", customer: "Joshua Lewis", customerInitials: "JL", category: "Computers & tablets", products: ["Mac Mini M2 Pro"], productCount: 1, status: "Processing", total: 1299.0, date: "Jan 18, 2024", }, ]; const PAGE_SIZE_OPTIONS = [10, 25, 50]; const revenueChartConfig = { thisYear: { label: "فروش ناخالص", color: palette.primary }, prevYear: { label: "سال قبل", theme: palette.secondary }, } satisfies ChartConfig; 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?.length ?? 0) > 0; if (!hasChildren) { return ( ); } return ( {item.children!.map((child) => ( {child.label} ))} ); }; 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) => { return (
{sidebarData.navGroups.map((group) => ( {group.title} {group.items.map((item) => ( ))} ))} {sidebarData.user && }
); }; const DashboardHeader = () => { return (
); }; const StatsCards = () => { return (
{statsData.map((stat) => { const formatter = stat.format === "currency" ? currencyFormatter : numberFormatter; return (

{formatter.format(stat.previousValue)} ماه قبل

{formatter.format(stat.value)}

{stat.isPositive ? ( ) : ( )} {stat.isPositive ? "+" : "-"} {stat.changePercent.toLocaleString("fa-IR", { minimumFractionDigits: 1, maximumFractionDigits: 1, })} ٪ نسبت به ماه قبل
); })}
); }; const SegmentationPanel = () => { const { active: activeSegment, handleHover } = useHoverHighlight(); const totalSegmentSales = segments.reduce((sum, s) => sum + s.value, 0); return (

فروش بر اساس دسته

{compactCurrencyFormatter.format(totalSegmentSales)} فروش ناخالص ماه جاری
{segments.map((segment, index) => (
{segments.map((segment) => (
{segment.name} {Math.round( (segment.value / totalSegmentSales) * 100, ).toLocaleString("fa-IR")} ٪
{currencyFormatter.format(segment.value)}
))}
دسته سفارش‌ها نسبت به قبل
{categoryBreakdown.map((row) => (
{row.name[0]}
{row.name}
{numberFormatter.format(row.orderCount)}
{row.isPositive ? ( ) : ( )} {row.changePercent.toLocaleString("fa-IR")}٪
))}
); }; function CustomTooltip({ active, payload, label, colors, }: any & { colors: { primary: string; secondary: string }; }) { if (!active || !payload?.length) return null; const thisYear = payload.find((p: any) => p.dataKey === "thisYear")?.value || 0; const prevYear = payload.find((p: any) => p.dataKey === "prevYear")?.value || 0; const diff = Number(thisYear) - Number(prevYear); const percentage = prevYear ? Math.round((diff / Number(prevYear)) * 100) : 0; const currentYear = new Date().getFullYear(); return (

{label}، {currentYear.toLocaleString("fa-IR")}

فروش ناخالص: {currencyFormatter.format(Number(thisYear))}
سال قبل: {currencyFormatter.format(Number(prevYear))}
= 0 ? "text-emerald-500" : "text-red-500", )} > {diff >= 0 ? "+" : ""} {percentage.toLocaleString("fa-IR")}٪ نسبت به سال قبل
); } const RevenueFlowChart = () => { const [period, setPeriod] = React.useState("6months"); React.useEffect(() => { if (typeof window === "undefined") return; const params = new URLSearchParams(window.location.search); const nextPeriod = params.get("period"); if (nextPeriod === "6months" || nextPeriod === "year") { setPeriod(nextPeriod); } }, []); React.useEffect(() => { if (typeof window === "undefined") return; const params = new URLSearchParams(window.location.search); if (period !== "6months") { params.set("period", period); } else { params.delete("period"); } const nextQuery = params.toString(); const nextUrl = nextQuery ? `${window.location.pathname}?${nextQuery}` : window.location.pathname; window.history.replaceState(null, "", nextUrl); }, [period]); const chartData = getDataForPeriod(period); const totalGrossSales = chartData.reduce( (acc, item) => acc + item.thisYear, 0, ); return (

{currencyFormatter.format(totalGrossSales)}

فروش ناخالص ({periodLabels[period]})

فروش ناخالص
سال قبل
بازه زمانی {(Object.keys(periodLabels) as TimePeriod[]).map((key) => ( setPeriod(key)} > {periodLabels[key]} ))}
compactCurrencyFormatter.format(value)} width={40} /> } cursor={{ fillOpacity: 0.05, radius: 4 }} />
); }; const statusStyles: Record = { Processing: "bg-amber-50 text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-900/30 dark:text-amber-400 dark:ring-amber-400/20", Shipped: "bg-blue-50 text-blue-700 ring-1 ring-inset ring-blue-700/10 dark:bg-blue-900/30 dark:text-blue-400 dark:ring-blue-400/20", Delivered: "bg-emerald-50 text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-900/30 dark:text-emerald-400 dark:ring-emerald-400/20", Cancelled: "bg-red-50 text-red-700 ring-1 ring-inset ring-red-600/10 dark:bg-red-900/30 dark:text-red-400 dark:ring-red-400/20", }; const RecentOrdersTable = () => { const [searchQuery, setSearchQuery] = React.useState(""); const [statusFilter, setStatusFilter] = React.useState("all"); const [currentPage, setCurrentPage] = React.useState(1); const [pageSize, setPageSize] = React.useState(10); const [isHydrated, setIsHydrated] = React.useState(false); const skipNextReset = React.useRef(true); const hasActiveFilters = statusFilter !== "all"; const clearFilters = () => { setStatusFilter("all"); }; const filteredOrders = React.useMemo(() => { return orders.filter((order) => { const q = searchQuery.toLowerCase(); const matchesSearch = order.orderNumber.toLowerCase().includes(q) || order.customer.toLowerCase().includes(q) || order.category.toLowerCase().includes(q); const matchesStatus = statusFilter === "all" || order.status === statusFilter; return matchesSearch && matchesStatus; }); }, [searchQuery, statusFilter]); const totalPages = Math.ceil(filteredOrders.length / pageSize); const paginatedOrders = React.useMemo(() => { const startIndex = (currentPage - 1) * pageSize; const endIndex = startIndex + pageSize; return filteredOrders.slice(startIndex, endIndex); }, [filteredOrders, currentPage, pageSize]); React.useEffect(() => { if (typeof window === "undefined") return; const params = new URLSearchParams(window.location.search); const statusParam = params.get("status"); const pageParam = Number.parseInt(params.get("page") ?? "", 10); const pageSizeParam = Number.parseInt(params.get("pageSize") ?? "", 10); setSearchQuery(params.get("q") ?? ""); setStatusFilter( statusParam && orderStatuses.includes(statusParam as OrderStatus) ? statusParam : "all", ); setCurrentPage(Number.isFinite(pageParam) && pageParam > 0 ? pageParam : 1); setPageSize(PAGE_SIZE_OPTIONS.includes(pageSizeParam) ? pageSizeParam : 10); setIsHydrated(true); }, []); React.useEffect(() => { if (!isHydrated) return; if (skipNextReset.current) { skipNextReset.current = false; return; } setCurrentPage(1); }, [searchQuery, statusFilter, pageSize, isHydrated]); React.useEffect(() => { if (!isHydrated) return; if (typeof window === "undefined") return; const params = new URLSearchParams(window.location.search); if (searchQuery) { params.set("q", searchQuery); } else { params.delete("q"); } if (statusFilter !== "all") { params.set("status", statusFilter); } else { params.delete("status"); } if (currentPage > 1) { params.set("page", String(currentPage)); } else { params.delete("page"); } if (pageSize !== PAGE_SIZE_OPTIONS[0]) { params.set("pageSize", String(pageSize)); } else { params.delete("pageSize"); } const nextQuery = params.toString(); const nextUrl = nextQuery ? `${window.location.pathname}?${nextQuery}` : window.location.pathname; window.history.replaceState(null, "", nextUrl); }, [searchQuery, statusFilter, currentPage, pageSize, isHydrated]); const goToPage = (page: number) => { setCurrentPage(Math.max(1, Math.min(page, totalPages))); }; return (
سفارش‌های اخیر {filteredOrders.length.toLocaleString("fa-IR")}
فیلتر بر اساس وضعیت setStatusFilter("all")} > همه وضعیت‌ها {orderStatuses.map((status) => ( setStatusFilter(status)} > {orderStatusLabels[status]} ))} {hasActiveFilters && ( <> )}
{hasActiveFilters && (
فیلترها: {statusFilter !== "all" && ( )}
)}
# سفارش دسته مشتری وضعیت مجموع سفارش تاریخ {paginatedOrders.length === 0 ? ( سفارشی با این فیلترها یافت نشد. ) : ( paginatedOrders.map((order, index) => ( {((currentPage - 1) * pageSize + index + 1).toLocaleString( "fa-IR", )}
{order.orderNumber} {order.productCount.toLocaleString("fa-IR")} قلم
{categoryLabels[order.category] ?? order.category}
{order.customerInitials} {order.customer}
{orderStatusLabels[order.status]} {currencyFormatter.format(order.total)} {formatOrderDate(order.date)} { event.preventDefault(); if (typeof window === "undefined") return; window.confirm( "این سفارش لغو شود؟ این عمل قابل بازگشت نیست.", ); }} >
)) )}
ردیف در هر صفحه: {filteredOrders.length === 0 ? "۰" : `${((currentPage - 1) * pageSize + 1).toLocaleString("fa-IR")}-${Math.min( currentPage * pageSize, filteredOrders.length, ).toLocaleString("fa-IR")}`}{" "} از {filteredOrders.length.toLocaleString("fa-IR")}
{Array.from({ length: Math.min(totalPages, 5) }, (_, i) => { let pageNum: number; if (totalPages <= 5) { pageNum = i + 1; } else if (currentPage <= 3) { pageNum = i + 1; } else if (currentPage >= totalPages - 2) { pageNum = totalPages - 4 + i; } else { pageNum = currentPage - 2 + i; } return ( ); })}
); }; const DashboardContent = () => { return (
); }; const Dashboard4 = ({ className }: { className?: string }) => { return ( رفتن به محتوای اصلی ); }; export { Dashboard4 };