Skip to content

Commit

Permalink
Merge pull request #2794 from weaveworks/UI-1566-makeEmptyTableRowMor…
Browse files Browse the repository at this point in the history
…eExtinsble

add empty table row prop so it can be configured from parent component
  • Loading branch information
Robin Sonefors authored Sep 27, 2022
2 parents 365a95e + 9795661 commit 0b36fcc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface Props {
dialogOpen?: boolean;
hasCheckboxes?: boolean;
hideSearchAndFilters?: boolean;
emptyMessagePlaceholder?: React.ReactNode;
}
//styled components
const EmptyRow = styled(TableRow)<{ colSpan: number }>`
Expand Down Expand Up @@ -331,6 +332,7 @@ function UnstyledDataTable({
hasCheckboxes: checkboxes,
dialogOpen,
hideSearchAndFilters,
emptyMessagePlaceholder,
}: Props) {
//URL info
const history = useHistory();
Expand Down Expand Up @@ -561,7 +563,9 @@ function UnstyledDataTable({
size="base"
/>
<Spacer padding="xxs" />
<Text color="neutral30">No data</Text>
{emptyMessagePlaceholder || (
<Text color="neutral30">No data</Text>
)}
</Flex>
</TableCell>
</EmptyRow>
Expand Down

0 comments on commit 0b36fcc

Please sign in to comment.