Fix conditional rendering of empty view
This commit is contained in:
1 parent
c6ef46133c
commit
0c608fdc8e
1 file changed
+1
-2
@@ -34,7 +34,6 @@ import { useTheme } from "@emotion/react";
|
|||||||
|
|
||||||
const DataTable = ({ headers, data, config = { emptyView: "No data" } }) => {
|
const DataTable = ({ headers, data, config = { emptyView: "No data" } }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
if ((headers?.length ?? 0) === 0) {
|
if ((headers?.length ?? 0) === 0) {
|
||||||
return "No data";
|
return "No data";
|
||||||
}
|
}
|
||||||
@@ -58,7 +57,7 @@ const DataTable = ({ headers, data, config = { emptyView: "No data" } }) => {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{(data?.length ?? 0 === 0) ? (
|
{(data?.length ?? 0) === 0 ? (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell
|
<TableCell
|
||||||
colSpan={headers.length}
|
colSpan={headers.length}
|
||||||
|
|||||||
Reference in new issue
Block a user