import React from 'react'; import { Hook } from '../hook'; import { Snackbar, SnackbarOrigin, } from '@mui/material'; import MuiAlert, { AlertProps } from '@mui/material/Alert'; const AlertMui = React.forwardRef( (props, ref) => ( ) ); interface AlertData { type: 'error' | 'warning' | 'info' | 'success', message: string, position?: SnackbarOrigin, autoHideDuration?: number, } interface AlertOutput { } export const Alert = Hook.Dialog(({ data, open, onClose }) => { const { type, message, position, autoHideDuration } = data; const handleClose = (event: any, reason?: string) => { if (reason === 'clickaway') { return; } if (onClose) { onClose({ data: {} }); } } return ( {message} ); });