diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-15 14:59:48 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-15 14:59:48 +0300 |
commit | 6c6b25ae182fdb5d55e0c5800bf0ba60ac0cede5 (patch) | |
tree | 6ea37de0ea058a90340267110b54e0054df09476 /src/components | |
parent | 694918dcf0565e14dc4cba69e89907be9bed1544 (diff) | |
download | which-ui-6c6b25ae182fdb5d55e0c5800bf0ba60ac0cede5.tar.gz |
feat: use more cool image
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/EmptyState/EmptyState.tsx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/components/EmptyState/EmptyState.tsx b/src/components/EmptyState/EmptyState.tsx index f79a391..1a8eec5 100644 --- a/src/components/EmptyState/EmptyState.tsx +++ b/src/components/EmptyState/EmptyState.tsx @@ -1,14 +1,17 @@ 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'; interface PropTypes { - variant?: 'default' | 'construction'; + variant?: 'default' | 'construction' | 'waiting'; message?: string; + smart?: boolean; } const useStyles = makeStyles(theme => ({ @@ -25,16 +28,22 @@ const CONTEXT = { construction: { icon: constructionIcon, tagline: 'Coming soon' + }, + waiting: { + icon: serverIcon, + tagline: 'Waiting for server' } }; -const EmptyState: React.FC<PropTypes> = ({ variant = 'default', message }) => { +const EmptyState: React.FC<PropTypes> = ({ variant = 'default', smart = false, message }) => { const classes = useStyles(); const { icon, tagline } = CONTEXT[variant]; + const Component = smart ? Image : 'img'; + return ( <Message tagline={tagline} message={message}> - <img src={icon} className={classes.img} alt="No content" /> + <Component src={icon} className={classes.img} alt="No content" /> </Message> ); }; |