feat: implement advanced reports, pagination for all tables, global settings, and discounts modules
This commit is contained in:
1 parent
a7ebb8d792
commit
69502fc380
14 files changed
+1042
-71
No files matched your search
@@ -1,12 +1,13 @@
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { Home, Users, ShoppingBag, ShoppingCart, Tag, Settings, LogOut } from 'lucide-react';
|
||||
import { Home, Users, ShoppingBag, ShoppingCart, Tag, Settings, LogOut, TrendingUp } from 'lucide-react';
|
||||
|
||||
const menuItems = [
|
||||
{ icon: Home, label: 'داشبورد', path: '/' },
|
||||
{ icon: Users, label: 'کاربران', path: '/users' },
|
||||
{ icon: ShoppingBag, label: 'محصولات', path: '/products' },
|
||||
{ icon: ShoppingCart, label: 'سفارشات', path: '/orders' },
|
||||
{ icon: Tag, label: 'تخفیفها', path: '/coupons' },
|
||||
{ icon: Tag, label: 'کدهای تخفیف', path: '/coupons' },
|
||||
{ icon: TrendingUp, label: 'گزارشات', path: '/reports' },
|
||||
{ icon: Settings, label: 'تنظیمات', path: '/settings' },
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
||||
|
||||
interface PaginationProps {
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
onPageChange: (page: number) => void;
|
||||
}
|
||||
|
||||
export default function Pagination({ currentPage, totalPages, onPageChange }: PaginationProps) {
|
||||
if (totalPages <= 1) return null;
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-between p-4 border-t border-gray-200 bg-gray-50">
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => onPageChange(currentPage - 1)}
|
||||
disabled={currentPage === 1}
|
||||
className="p-2 rounded-lg border border-gray-200 bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
<ChevronRight className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
<span className="text-sm font-bold text-gray-700 px-4">
|
||||
صفحه {currentPage} از {totalPages}
|
||||
</span>
|
||||
|
||||
<button
|
||||
onClick={() => onPageChange(currentPage + 1)}
|
||||
disabled={currentPage === totalPages}
|
||||
className="p-2 rounded-lg border border-gray-200 bg-white text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
<ChevronLeft className="w-5 h-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user