1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { CustomStyleRulesCallback } from 'common/custom-theme';
7 import { WithStyles, withStyles } from '@material-ui/core/styles';
8 import { DefaultViewDataProps, DefaultView } from 'components/default-view/default-view';
9 import { ArvadosTheme } from 'common/custom-theme';
10 import { DetailsIcon } from 'components/icon/icon';
12 type CssRules = 'classRoot';
14 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
16 marginTop: theme.spacing(4),
17 marginBottom: theme.spacing(4),
20 type DataTableDefaultViewDataProps = Partial<Pick<DefaultViewDataProps, 'icon' | 'messages' | 'filtersApplied'>>;
21 type DataTableDefaultViewProps = DataTableDefaultViewDataProps & WithStyles<CssRules>;
23 export const DataTableDefaultView = withStyles(styles)(
24 ({ classes, ...props }: DataTableDefaultViewProps) => {
25 const icon = props.icon || DetailsIcon;
26 const filterWarning: string[] = props.filtersApplied ? ['Filters are applied to the data.'] : [];
27 const messages = filterWarning.concat(props.messages || ['No items found']);
28 return <DefaultView {...classes} {...{ icon, messages }} />;