1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import Typography from '@material-ui/core/Typography';
7 import { WithStyles, withStyles, StyleRulesCallback } from '@material-ui/core/styles';
8 import { ArvadosTheme } from 'src/common/custom-theme';
9 import { IconType } from '../icon/icon';
11 type CssRules = 'container' | 'icon';
12 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
17 color: theme.palette.grey["500"],
22 export interface EmptyStateDataProps {
28 type EmptyStateProps = EmptyStateDataProps & WithStyles<CssRules>;
30 export const EmptyState = withStyles(styles)(
31 class extends React.Component<EmptyStateProps, {}> {
33 const {classes, message, details, icon: Icon, children} = this.props;
35 <Typography className={classes.container} component="div">
36 <Icon className={classes.icon}/>
37 <Typography variant="body1" gutterBottom>{message}</Typography>
38 {details && <Typography gutterBottom>{details}</Typography>}
39 {children && <Typography gutterBottom>{children}</Typography>}