From 64314eed258bc30ed4a3bfa9df24805d4835c37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Mon, 20 May 2024 04:16:41 +0400 Subject: [PATCH] Create AuthAlert component --- components/auth-form/auth-alert.js | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 components/auth-form/auth-alert.js diff --git a/components/auth-form/auth-alert.js b/components/auth-form/auth-alert.js new file mode 100644 index 0000000..3e35961 --- /dev/null +++ b/components/auth-form/auth-alert.js @@ -0,0 +1,35 @@ +import PropTypes from 'prop-types' +import Snackbar from '@mui/material/Snackbar' +import Alert from '@mui/material/Alert' + +export default function AuthAlert({isOpen, setIsOpen, message, severity}) { + const handleClose = (event, reason) => { + if (reason === 'clickaway') { + return + } + + setIsOpen(false) + } + + return ( +
+ + + {message} + + +
+ ) +} + +AuthAlert.propTypes = { + isOpen: PropTypes.bool.isRequired, + setIsOpen: PropTypes.func.isRequired, + message: PropTypes.string.isRequired, + severity: PropTypes.string.isRequired +}