import "antd-mobile/es/modal/style";
import _Modal from "antd-mobile/es/modal";

var fn = function fn(_ref) {
  var _ref$title = _ref.title,
      title = _ref$title === void 0 ? '提示' : _ref$title,
      _ref$cancelText = _ref.cancelText,
      cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
      _ref$confirmText = _ref.confirmText,
      confirmText = _ref$confirmText === void 0 ? '确定' : _ref$confirmText,
      _ref$showCancel = _ref.showCancel,
      showCancel = _ref$showCancel === void 0 ? true : _ref$showCancel,
      _ref$content = _ref.content,
      content = _ref$content === void 0 ? undefined : _ref$content;
  return new Promise(function (resolve, reject) {
    var confirm = {
      text: confirmText,
      onPress: function onPress() {
        return resolve({
          confirm: true
        });
      }
    };
    var cancel = {
      text: cancelText,
      onPress: function onPress() {
        return resolve({
          confirm: false
        });
      }
    };

    _Modal.alert(title, content, showCancel ? [cancel, confirm] : [confirm]);
  });
};

export default fn;