mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-22 09:37:57 +00:00
26 lines
624 B
JavaScript
26 lines
624 B
JavaScript
import React, { useState } from 'react';
|
|
import { Snackbar, Alert, Button } from '@mui/material';
|
|
import useAlertStore from '../store/alerts';
|
|
|
|
const AlertPopup = () => {
|
|
const { open, message, severity, hideAlert } = useAlertStore();
|
|
|
|
const handleClose = () => {
|
|
hideAlert();
|
|
};
|
|
|
|
return (
|
|
<Snackbar
|
|
open={open}
|
|
autoHideDuration={3000}
|
|
onClose={handleClose}
|
|
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
|
|
>
|
|
<Alert onClose={handleClose} severity={severity} sx={{ width: '100%' }}>
|
|
{message}
|
|
</Alert>
|
|
</Snackbar>
|
|
);
|
|
};
|
|
|
|
export default AlertPopup;
|