@@ -1,14 +1,16 @@
|
||||
import Alert from "@mui/material/Alert";
|
||||
import Alert, { AlertColor } from "@mui/material/Alert";
|
||||
import Snackbar from "@mui/material/Snackbar";
|
||||
|
||||
export function SnackbarAlert({
|
||||
open,
|
||||
setOpen,
|
||||
message,
|
||||
severity = "success",
|
||||
}: {
|
||||
open: boolean;
|
||||
setOpen: Function;
|
||||
message: string;
|
||||
severity?: AlertColor;
|
||||
}) {
|
||||
return (
|
||||
<Snackbar
|
||||
@@ -17,7 +19,11 @@ export function SnackbarAlert({
|
||||
onClose={() => setOpen(false)}
|
||||
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
|
||||
>
|
||||
<Alert onClose={() => setOpen(false)} sx={{ width: "100%" }}>
|
||||
<Alert
|
||||
severity={severity}
|
||||
onClose={() => setOpen(false)}
|
||||
sx={{ width: "100%" }}
|
||||
>
|
||||
{message}
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
|
||||
Reference in New Issue
Block a user