add cart API's (add , delete , get)
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
interface PaginationProps {
|
||||
totalPages: number;
|
||||
currentPage: number;
|
||||
onPageChange: (page: number) => void;
|
||||
onPageChangeAction: (page: number) => void;
|
||||
}
|
||||
|
||||
export default function ClientPagination({ totalPages, currentPage, onPageChange }: PaginationProps) {
|
||||
export default function ClientPagination({ totalPages, currentPage, onPageChangeAction }: PaginationProps) {
|
||||
if (totalPages <= 1) return null;
|
||||
|
||||
const getPaginationItems = () => {
|
||||
@@ -55,7 +55,7 @@ export default function ClientPagination({ totalPages, currentPage, onPageChange
|
||||
<div className="flex justify-center items-center gap-2 mt-10 mb-6 flex-wrap" dir="rtl">
|
||||
{/* دکمه قبلی */}
|
||||
<button
|
||||
onClick={() => onPageChange(currentPage - 1)}
|
||||
onClick={() => onPageChangeAction(currentPage - 1)}
|
||||
disabled={currentPage <= 1}
|
||||
className="px-3 cursor-pointer py-2 md:px-4 h-10 flex items-center justify-center rounded-xl disabled:opacity-40 disabled:cursor-not-allowed bg-[#1A2332] text-gray-300 hover:bg-[#1A2332]/80 hover:text-white transition-all duration-300 text-sm md:text-base font-medium"
|
||||
>
|
||||
@@ -76,7 +76,7 @@ export default function ClientPagination({ totalPages, currentPage, onPageChange
|
||||
return (
|
||||
<button
|
||||
key={index}
|
||||
onClick={() => onPageChange(page as number)}
|
||||
onClick={() => onPageChangeAction(page as number)}
|
||||
className={`min-w-[40px] cursor-pointer h-10 flex items-center justify-center rounded-xl transition-all duration-300 text-sm md:text-base font-medium ${
|
||||
currentPage === page
|
||||
? 'bg-[#ffb900] text-[#1A2332] font-bold shadow-lg shadow-[#ffb900]/30 scale-105' // استایل دکمه فعال (زرد)
|
||||
@@ -91,7 +91,7 @@ export default function ClientPagination({ totalPages, currentPage, onPageChange
|
||||
|
||||
{/* دکمه بعدی */}
|
||||
<button
|
||||
onClick={() => onPageChange(currentPage + 1)}
|
||||
onClick={() => onPageChangeAction(currentPage + 1)}
|
||||
disabled={currentPage >= totalPages}
|
||||
className="px-3 cursor-pointer py-2 md:px-4 h-10 flex items-center justify-center rounded-xl disabled:opacity-40 disabled:cursor-not-allowed bg-[#1A2332] text-gray-300 hover:bg-[#1A2332]/80 hover:text-white transition-all duration-300 text-sm md:text-base font-medium"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user