import * as React from 'react'; import Snackbar from '@mui/material/Snackbar'; import MuiAlert, { AlertProps } from '@mui/material/Alert'; import { useGlobalInfoStore } from "../../context/globalInfo"; const Alert = React.forwardRef(function Alert( props, ref, ) { return ; }); export interface AlertSnackbarProps { severity: 'error' | 'warning' | 'info' | 'success', message: string, isOpen: boolean, }; export const AlertSnackbar = ({ severity, message, isOpen }: AlertSnackbarProps) => { const [open, setOpen] = React.useState(isOpen); const { closeNotify } = useGlobalInfoStore(); const handleClose = (event?: React.SyntheticEvent | Event, reason?: string) => { if (reason === 'clickaway') { return; } closeNotify(); setOpen(false); }; return ( {message} ); }