import classNames from "classnames"; import toast from "react-hot-toast"; import { Check, Info } from "../icon"; type IToast = { message: string; toastVisible: boolean; onClose: () => void; }; export const SuccessToast = ({ message, toastVisible, onClose }: IToast) => (

{message}

); export const ErrorToast = ({ message, toastVisible, onClose }: IToast) => (

{message}

); export const WarningToast = ({ message, toastVisible, onClose }: IToast) => (

{message}

); export const DefaultToast = ({ message, toastVisible, onClose }: IToast) => (

{message}

); const TOAST_VISIBLE_DURATION = 6000; export function showToast( message: string, variant: "success" | "warning" | "error", duration = TOAST_VISIBLE_DURATION ) { const onClose = () => { toast.dismiss(); }; switch (variant) { case "success": return toast.custom( (t) => , { duration } ); case "error": return toast.custom( (t) => , { duration } ); case "warning": return toast.custom( (t) => , { duration } ); default: return toast.custom( (t) => , { duration } ); } }