1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
7 import { DefaultViewDataProps, DefaultView } from '~/components/default-view/default-view';
8 import { ArvadosTheme } from '~/common/custom-theme';
9 import { DetailsIcon } from '~/components/icon/icon';
11 type CssRules = 'classRoot';
13 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
15 marginTop: theme.spacing.unit * 4,
16 marginBottom: theme.spacing.unit * 4,
19 type DataTableDefaultViewDataProps = Partial<Pick<DefaultViewDataProps, 'icon' | 'messages'>>;
20 type DataTableDefaultViewProps = DataTableDefaultViewDataProps & WithStyles<CssRules>;
22 export const DataTableDefaultView = withStyles(styles)(
23 ({ classes, ...props }: DataTableDefaultViewProps) => {
24 const icon = props.icon || DetailsIcon;
25 const messages = props.messages || ['No items found'];
26 return <DefaultView {...classes} {...{ icon, messages }} />;