default snackbar

This commit is contained in:
Ehsan
2024-10-25 03:52:43 +03:30
parent 2a043e5932
commit e874284bb6
2 changed files with 36 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
"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;
+1
View File
@@ -54,6 +54,7 @@ function SearchBar() {
<SearchD />
</div>
</Button>
{/* <AlertMsg /> */}
</ButtonGroup>
);
}