mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 05:39:45 +08:00
* [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * Added replace remediation action * Add submit logic * Add submit alt text logic, generate AI alt text * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation --------- Co-authored-by: Raz Ohad <admin@bainternet.info>
38 lines
884 B
JavaScript
38 lines
884 B
JavaScript
import Alert from '@elementor/ui/Alert';
|
|
import Snackbar from '@elementor/ui/Snackbar';
|
|
import { useNotificationSettings } from '@ea11y/hooks';
|
|
|
|
const Notifications = ({ type, message }) => {
|
|
const {
|
|
showNotification,
|
|
setShowNotification,
|
|
setNotificationMessage,
|
|
setNotificationType,
|
|
} = useNotificationSettings();
|
|
|
|
const closeNotification = () => {
|
|
setShowNotification(!showNotification);
|
|
setNotificationMessage('');
|
|
setNotificationType('');
|
|
};
|
|
|
|
return (
|
|
<Snackbar
|
|
open={showNotification}
|
|
autoHideDuration={type === 'error' ? 10000 : 2000}
|
|
onClose={closeNotification}
|
|
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
|
|
sx={{ zIndex: 99999 }}
|
|
>
|
|
<Alert
|
|
onClose={() => setShowNotification(!showNotification)}
|
|
severity={type}
|
|
variant="filled"
|
|
>
|
|
{message}
|
|
</Alert>
|
|
</Snackbar>
|
|
);
|
|
};
|
|
|
|
export default Notifications;
|