import toastr from 'toastr';
import { Option } from 'funfix';

toastr.options = {
  toastClass: 'alert',
  "positionClass": "toast-top-center",
  "timeOut": "1200",
  iconClasses: {
    error: 'alert-info',
    info: 'alert-info',
    success: 'alert-info',
    warning: 'alert-info',
  }
};

const toastrMessage = (string) => {
  toastr.info(Option.of(string).getOrElse("操作成功"));
};

export { toastrMessage as t };
