import { confirm, alert } from 'remax/ali';

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;

  if (showCancel) {
    return confirm({
      title: title,
      content: content,
      confirmButtonText: confirmText,
      cancelButtonText: cancelText
    });
  }

  return alert({
    title: title,
    content: content,
    buttonText: confirmText
  }).then(function () {
    return Promise.resolve({
      confirm: true
    });
  });
};

export default fn;