"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _toutiao = require("remax/toutiao");

/*
 * @Author: codingfly
 * @Description:
 * @Date: 2022-02-21 08:08:15
 * @LastEditTime: 2022-06-08 10:27:01
 * @FilePath: \remaxui\src\show-toast\one\index.tt.tsx
 */
var _default = function _default(_ref) {
  var title = _ref.title,
      icon = _ref.icon,
      _ref$duration = _ref.duration,
      duration = _ref$duration === void 0 ? 3000 : _ref$duration;
  return new Promise(function (resolve) {
    (0, _toutiao.showToast)({
      type: icon,
      content: title,
      duration: duration,
      success: function success() {
        setTimeout(function () {
          resolve('');
        }, duration);
      }
    });
  });
};

exports.default = _default;