X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/4a8d85d10073d2555253bdb631d293eaf7deccbf..76215c43cae99e1ce7964dcfafae59b2134f72b3:/src/components/empty-state/empty-state.tsx diff --git a/src/components/empty-state/empty-state.tsx b/src/components/empty-state/empty-state.tsx new file mode 100644 index 00000000..b048e327 --- /dev/null +++ b/src/components/empty-state/empty-state.tsx @@ -0,0 +1,46 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import * as React from 'react'; +import Typography from '@material-ui/core/Typography'; +import { WithStyles, withStyles, StyleRulesCallback } from '@material-ui/core/styles'; +import { ArvadosTheme } from 'src/common/custom-theme'; +import IconBase from '../icon/icon'; + +export interface EmptyStateDataProps { + message: string; + icon: string; + details?: string; +} + +type EmptyStateProps = EmptyStateDataProps & WithStyles; + +class EmptyState extends React.Component { + + render() { + const { classes, message, details, icon, children } = this.props; + return ( + + + {message} + { details && {details} } + { children && {children} } + + ); + } + +} + +type CssRules = 'container' | 'icon'; +const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + container: { + textAlign: 'center' + }, + icon: { + color: theme.palette.grey["500"], + fontSize: '72px' + } +}); + +export default withStyles(styles)(EmptyState); \ No newline at end of file