Hide table footer when all groups are empty
This commit is contained in:
@ -70,6 +70,10 @@ function Table({ data, columns, viewName, viewIcon }: OwnProps) {
|
|||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
{table
|
||||||
|
.getFooterGroups()
|
||||||
|
.flatMap((group) => group.headers)
|
||||||
|
.filter((header) => !!header.column.columnDef.footer).length > 0 && (
|
||||||
<tfoot>
|
<tfoot>
|
||||||
{table.getFooterGroups().map((footerGroup) => (
|
{table.getFooterGroups().map((footerGroup) => (
|
||||||
<tr key={footerGroup.id}>
|
<tr key={footerGroup.id}>
|
||||||
@ -86,7 +90,7 @@ function Table({ data, columns, viewName, viewIcon }: OwnProps) {
|
|||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
)}
|
||||||
</StyledTable>
|
</StyledTable>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user