import { IconButton, makeStyles, Snackbar, SnackbarContent, } from '@material-ui/core'; import ErrorIcon from '@material-ui/icons/Error'; import CloseIcon from '@material-ui/icons/Close'; import React from 'react'; import PropTypes from 'prop-types'; const SnackBarStyles = makeStyles(theme => ({ error: { backgroundColor: theme.palette.error.dark, }, message: { display: 'flex', alignItems: 'center', }, icon: { marginRight: '20px', fontSize: 20, }, })); function ErrorSnackBar({ open, closeHandle, errorMessage }) { const classes = SnackBarStyles(); return ( {errorMessage || 'An unexpected error occurred. Please try again'} } action={[ , ]} /> ); } ErrorSnackBar.propTypes = { open: PropTypes.bool, closeHandle: PropTypes.func, errorMessage: PropTypes.string, }; export default ErrorSnackBar;