default snackbar
This commit is contained in:
@@ -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;
|
||||
@@ -54,6 +54,7 @@ function SearchBar() {
|
||||
<SearchD />
|
||||
</div>
|
||||
</Button>
|
||||
{/* <AlertMsg /> */}
|
||||
</ButtonGroup>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user