feat(FE-361): Add pagination control to supplier purchases table

This commit is contained in:
rstubryan
2025-12-13 11:21:04 +07:00
parent 0983f154d2
commit 81f98c5f06
@@ -20,6 +20,7 @@ import {
} from '@/types/api/report/logistic-stock'; } from '@/types/api/report/logistic-stock';
import { isResponseSuccess } from '@/lib/api-helper'; import { isResponseSuccess } from '@/lib/api-helper';
import { useTableFilter } from '@/services/hooks/useTableFilter'; import { useTableFilter } from '@/services/hooks/useTableFilter';
import Pagination from '@/components/Pagination';
interface Totals { interface Totals {
totalQty: number; totalQty: number;
@@ -464,6 +465,7 @@ const PurchasesPerSupplierTab = () => {
const tableColumns = getTableColumns(totals); const tableColumns = getTableColumns(totals);
return ( return (
<>
<Card <Card
key={supplier.id} key={supplier.id}
title={supplier.supplier.name} title={supplier.supplier.name}
@@ -480,7 +482,8 @@ const PurchasesPerSupplierTab = () => {
containerClassName: 'w-full', containerClassName: 'w-full',
tableWrapperClassName: 'overflow-x-auto mt-4', tableWrapperClassName: 'overflow-x-auto mt-4',
tableClassName: 'w-full table-auto text-sm', tableClassName: 'w-full table-auto text-sm',
headerRowClassName: 'border-b border-b-gray-200 bg-gray-50', headerRowClassName:
'border-b border-b-gray-200 bg-gray-50',
headerColumnClassName: headerColumnClassName:
'px-4 py-3 text-xs font-semibold text-gray-700 text-left border border-gray-200', 'px-4 py-3 text-xs font-semibold text-gray-700 text-left border border-gray-200',
bodyRowClassName: bodyRowClassName:
@@ -494,7 +497,19 @@ const PurchasesPerSupplierTab = () => {
'px-4 py-3 text-xs text-gray-900 whitespace-nowrap', 'px-4 py-3 text-xs text-gray-900 whitespace-nowrap',
}} }}
/> />
<Pagination
key={supplier.id}
currentPage={1}
totalItems={supplier.items.length}
onPageChange={() => {}}
onRowChange={() => {}}
onNextPage={() => {}}
onPrevPage={() => {}}
rowOptions={[10, 25, 50, 100]}
itemsPerPage={10}
/>
</Card> </Card>
</>
); );
}) })
)} )}