import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Image from '../Image/Image'; import Message from '../Message/Message'; import noContentIcon from '../../assets/noContent.svg'; import constructionIcon from '../../assets/construction.svg'; import serverIcon from '../../assets/server.svg'; import errorIcon from '../../assets/error.svg'; interface PropTypes { variant?: 'default' | 'construction' | 'waiting' | 'error'; message?: string; smart?: boolean; } const useStyles = makeStyles(theme => ({ img: { width: theme.spacing(24) } })); const CONTEXT = { default: { icon: noContentIcon, tagline: 'No content' }, construction: { icon: constructionIcon, tagline: 'Coming soon' }, waiting: { icon: serverIcon, tagline: 'Waiting for server' }, error: { icon: errorIcon, tagline: 'Something went wrong' } }; const EmptyState: React.FC = ({ variant = 'default', smart = false, message }) => { const classes = useStyles(); const { icon, tagline } = CONTEXT[variant]; const Component = smart ? Image : 'img'; return ( ); }; export default EmptyState;