import _Toast from 'antd-mobile/es/components/toast';
export default (function(_ref) {
  var _ref$icon = _ref.icon,
    icon = _ref$icon === void 0 ? 'success' : _ref$icon,
    title = _ref.title,
    _ref$duration = _ref.duration,
    duration = _ref$duration === void 0 ? 3000 : _ref$duration,
    _ref$mask = _ref.mask,
    mask = _ref$mask === void 0 ? false : _ref$mask;
  return new Promise(function(resolve) {
    _Toast.show({
      icon: icon === 'none' ? undefined : icon,
      content: title,
      duration: duration,
      maskClickable: !mask,
      afterClose: function afterClose() {
        return resolve('');
      },
    });
  });
});
