mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fix: pagination positioning
This commit is contained in:
@@ -731,29 +731,6 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isLoading && data.length > 0 && meta && (
|
|
||||||
<div className='max-w-sm ml-auto'>
|
|
||||||
<Pagination
|
|
||||||
totalItems={meta.total_results || 0}
|
|
||||||
itemsPerPage={meta.limit || 0}
|
|
||||||
currentPage={meta.page || 0}
|
|
||||||
onPrevPage={() =>
|
|
||||||
setCurrentPage((curr) => (curr > 1 ? curr - 1 : curr))
|
|
||||||
}
|
|
||||||
onNextPage={() =>
|
|
||||||
setCurrentPage((curr) =>
|
|
||||||
meta.total_pages && curr < meta.total_pages
|
|
||||||
? curr + 1
|
|
||||||
: curr
|
|
||||||
)
|
|
||||||
}
|
|
||||||
onPageChange={(pageNumber) => setCurrentPage(pageNumber)}
|
|
||||||
rowOptions={[10, 20, 50, 100]}
|
|
||||||
onRowChange={setPageSize}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isLoading &&
|
{!isLoading &&
|
||||||
data.length > 0 &&
|
data.length > 0 &&
|
||||||
data.map((customerReport) => {
|
data.map((customerReport) => {
|
||||||
@@ -848,6 +825,27 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
{!isLoading && data.length > 0 && meta && (
|
||||||
|
<div className='mt-5 px-3'>
|
||||||
|
<Pagination
|
||||||
|
totalItems={meta.total_results || 0}
|
||||||
|
itemsPerPage={meta.limit || 0}
|
||||||
|
currentPage={meta.page || 0}
|
||||||
|
onPrevPage={() =>
|
||||||
|
setCurrentPage((curr) => (curr > 1 ? curr - 1 : curr))
|
||||||
|
}
|
||||||
|
onNextPage={() =>
|
||||||
|
setCurrentPage((curr) =>
|
||||||
|
meta.total_pages && curr < meta.total_pages ? curr + 1 : curr
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onPageChange={(pageNumber) => setCurrentPage(pageNumber)}
|
||||||
|
rowOptions={[10, 20, 50, 100]}
|
||||||
|
onRowChange={setPageSize}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Filter Modal */}
|
{/* Filter Modal */}
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
|
|||||||
|
|
||||||
handleFilterModalOpenRef.current = () => {
|
handleFilterModalOpenRef.current = () => {
|
||||||
const restoredFilterBy =
|
const restoredFilterBy =
|
||||||
dataTypeOptions.find((opt) => opt.value === filterParams.filter_by) || null;
|
dataTypeOptions.find((opt) => opt.value === filterParams.filter_by) ||
|
||||||
|
null;
|
||||||
|
|
||||||
const supplierIdList = filterParams.supplier_ids
|
const supplierIdList = filterParams.supplier_ids
|
||||||
? filterParams.supplier_ids.split(',')
|
? filterParams.supplier_ids.split(',')
|
||||||
@@ -662,29 +663,6 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isLoading && data.length > 0 && meta && (
|
|
||||||
<div className='max-w-sm ml-auto'>
|
|
||||||
<Pagination
|
|
||||||
totalItems={meta.total_results || 0}
|
|
||||||
itemsPerPage={meta.limit || 0}
|
|
||||||
currentPage={meta.page || 0}
|
|
||||||
onPrevPage={() =>
|
|
||||||
setCurrentPage((curr) => (curr > 1 ? curr - 1 : curr))
|
|
||||||
}
|
|
||||||
onNextPage={() =>
|
|
||||||
setCurrentPage((curr) =>
|
|
||||||
meta.total_pages && curr < meta.total_pages
|
|
||||||
? curr + 1
|
|
||||||
: curr
|
|
||||||
)
|
|
||||||
}
|
|
||||||
onPageChange={(pageNumber) => setCurrentPage(pageNumber)}
|
|
||||||
rowOptions={[10, 20, 50, 100]}
|
|
||||||
onRowChange={setPageSize}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isLoading &&
|
{!isLoading &&
|
||||||
data.length > 0 &&
|
data.length > 0 &&
|
||||||
data.map((supplierReport) => {
|
data.map((supplierReport) => {
|
||||||
@@ -772,6 +750,27 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
|
|||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
{!isLoading && data.length > 0 && meta && (
|
||||||
|
<div className='mt-5 px-3'>
|
||||||
|
<Pagination
|
||||||
|
totalItems={meta.total_results || 0}
|
||||||
|
itemsPerPage={meta.limit || 0}
|
||||||
|
currentPage={meta.page || 0}
|
||||||
|
onPrevPage={() =>
|
||||||
|
setCurrentPage((curr) => (curr > 1 ? curr - 1 : curr))
|
||||||
|
}
|
||||||
|
onNextPage={() =>
|
||||||
|
setCurrentPage((curr) =>
|
||||||
|
meta.total_pages && curr < meta.total_pages ? curr + 1 : curr
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onPageChange={(pageNumber) => setCurrentPage(pageNumber)}
|
||||||
|
rowOptions={[10, 20, 50, 100]}
|
||||||
|
onRowChange={setPageSize}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Filter Modal */}
|
{/* Filter Modal */}
|
||||||
|
|||||||
Reference in New Issue
Block a user