Files
plaidware-wms-web/src/components/SnackBar/index.js
Dikshajain39511 d32a8892e3 Feature/wms 48 (#46)
* create warehouse
* edit warehouse changes
* Update: linted and formatted
* add warehouse button
* Update: linted

Co-authored-by: [Diksha] <[diksha39511@gmail.com]>
Co-authored-by: Llewellyn Dsouza <lledsouza2209@gmail.com>
2022-02-07 16:57:53 +05:30

26 lines
715 B
JavaScript

import React from 'react';
import { Snackbar } from '@mui/material';
import PropTypes from 'prop-types';
import MuiAlert from '@mui/material/Alert';
export default function SnackBar({ message, open, handleClose }) {
const Alert = React.forwardRef(function Alert(props, ref) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
});
return (
<>
<Snackbar open={open} autoHideDuration={2000} onClose={handleClose}>
<Alert severity="success" sx={{ width: '100%' }} onClose={handleClose}>
{message}
</Alert>
</Snackbar>
</>
);
}
SnackBar.propTypes = {
message: PropTypes.string,
open: PropTypes.bool,
handleClose: PropTypes.bool
};