feat: add component when a table is empty

This commit is contained in:
Sérgio Salgado 2021-02-12 17:45:55 +00:00 committed by Josh Harvey
parent c17ecc770b
commit 48c8d808b0
5 changed files with 71 additions and 3 deletions

View file

@ -20,6 +20,7 @@ import {
import { H4 } from 'src/components/typography'
import { ReactComponent as ExpandClosedIcon } from 'src/styling/icons/action/expand/closed.svg'
import { ReactComponent as ExpandOpenIcon } from 'src/styling/icons/action/expand/open.svg'
import { ReactComponent as EmptyTableIcon } from 'src/styling/icons/table/empty-table.svg'
import styles from './DataTable.styles'
@ -167,7 +168,12 @@ const DataTable = ({
</THead>
<TBody className={classes.body}>
{loading && <H4>Loading...</H4>}
{!loading && R.isEmpty(data) && <H4>{emptyText}</H4>}
{!loading && R.isEmpty(data) && (
<div className={classes.emptyTable}>
<EmptyTableIcon />
<H4>{emptyText}</H4>
</div>
)}
<AutoSizer disableWidth>
{({ height }) => (
<List