import { toast } from "react-toastify"; import { Box, Typography } from "@mui/material"; import { Dangerous } from "@mui/icons-material"; export const errorServerToast = (toastContainer) => toast.error( () => ( {"The request failed due to an internal error."} ), { icon: false, containerId: toastContainer, autoClose: 5000, hideProgressBar: true, pauseOnHover: true, closeOnClick: false, draggable: true, } ); export const errorUnauthorizedToast = (toastContainer) => toast.error( () => ( {"The user is not authorized to make the request."} ), { icon: false, containerId: toastContainer, autoClose: 3000, hideProgressBar: true, pauseOnHover: true, closeOnClick: false, draggable: true, } ); export const errorLogicToast = (message, toastContainer) => toast.error( () => ( {message || "The request was well-formed but was unable to be followed due to semantic errors."} ), { icon: false, containerId: toastContainer, autoClose: false, closeOnClick: false, draggable: false, } ); export const errorValidationToast = (message, toastContainer) => toast.error( () => ( {message || "The request was well-formed but was unable to be followed due to semantic errors."} ), { icon: false, containerId: toastContainer, autoClose: false, closeOnClick: false, draggable: false, } ); export const errorTooManyToast = (toastContainer) => toast.error( () => ( {"Too many requests have been sent within a given time span."} ), { icon: false, containerId: toastContainer, autoClose: false, closeOnClick: false, draggable: false, } ); export const errorClientToast = (toastContainer) => toast.error( () => ( { "The API request is invalid or improperly formed. Consequently, the API server could not understand the request." } ), { icon: false, containerId: toastContainer, autoClose: false, closeOnClick: false, draggable: false, } );