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:
parent
66f83b24bd
commit
4b2e47f8f9
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user