Files
nobat724_front/app/component/AlertMsg.js
T
2024-10-25 03:52:43 +03:30

36 lines
676 B
JavaScript

"use client";
import { Alert, Snackbar } from "@mui/material";
import { useState } from "react";
function AlertMsg() {
const [open, setOpen] = useState(true);
const handleClick = () => {
setOpen(true);
};
const handleClose = (event, reason) => {
if (reason === "clickaway") {
return;
}
setOpen(false);
};
return (
<Snackbar open={open} autoHideDuration={6000} onClose={handleClose}>
<Alert
onClose={handleClose}
severity="success"
variant="filled"
sx={{ width: "100%" }}
>
This is a success Alert inside a Snackbar!
</Alert>
</Snackbar>
);
}
export default AlertMsg;