import { showToast, showLoadingToast } from "vant";

let Loading: any = null;

export function toast(msg: string, options?: CustomObject) {
  showToast({
    message: msg,
    className: "particulars-detail-popup",
    ...options
  });
}

export function showLoading() {
  Loading = showLoadingToast({
    message: "loading...",
    forbidClick: false,
    overlay: true,
    duration: 0,
    className: "particulars-detail-popup",
  });
}

export function closeLoading() {
  Loading.close();
}