fix(table): add empty content only when table size is 0 #2742 (#2747)

* fix(table): add empty content only when table size is 0 #2742

* fix(table): added changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
This commit is contained in:
Shrinidhi Upadhyaya 2024-04-17 15:56:47 +02:00 committed by GitHub
parent cadbb30cfb
commit 2126ea1863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/table": patch
---
Fixes adding of empty content at the bottom of the table when rows present in Table (#2742)

View File

@ -121,7 +121,9 @@ const TableBody = forwardRef<"tbody", TableBodyProps>((props, ref) => {
>
{bodyProps.loadingContent}
</td>
{!emptyContent && <td className={slots?.emptyWrapper({class: classNames?.emptyWrapper})} />}
{!emptyContent && collection.size === 0 ? (
<td className={slots?.emptyWrapper({class: classNames?.emptyWrapper})} />
) : null}
</tr>
);
}