"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 ( This is a success Alert inside a Snackbar! ); } export default AlertMsg;