1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-26 00:21:36 +01:00

Refactor pagination condition in RichTable component

This commit is contained in:
Aleksandr Gumroian 2024-12-04 14:02:52 +01:00
parent 66f83b24bd
commit 4b2e47f8f9
No known key found for this signature in database
GPG Key ID: 9E77849C64F0A733

View File

@ -64,13 +64,15 @@ function RichTable({
}, },
}); });
const paginationIsNeeded = tableData.length > pageSize && withPagination;
return ( return (
<div className="table-responsive"> <div className="table-responsive">
<table className="table table-hover text-nowrap"> <table className="table table-hover text-nowrap">
<RichTableHeader table={table} flexRender={flexRender} /> <RichTableHeader table={table} flexRender={flexRender} />
<RichTableBody table={table} flexRender={flexRender} /> <RichTableBody table={table} flexRender={flexRender} />
</table> </table>
{withPagination && ( {paginationIsNeeded && (
<RichTablePagination <RichTablePagination
table={table} table={table}
tablePageSize={pageSize} tablePageSize={pageSize}