import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";

export const showMessage = (message, type = 1, title = "", showAtBottom = false) => {
  const position = showAtBottom  === true ? toast.POSITION.BOTTOM_CENTER: toast.POSITION.TOP_RIGHT;
  switch (type) {
    case -2: {
      toast.error(message, {
        position: position,
      });
      break;
    }

    case -1: {
      toast.warn(message, {
        position: position,
      });
      break;
    }

    case 0: {
      toast.info(message, {
        position: position,
      });
      break;
    }
    case 1:
    default: {
      toast.success(message, {
        position: position,
        className: "toast-success",
      });
    }
  }
};

