import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";

/**
 * index.js
 *
 * @Author: apple
 * @Date: 2018/1/22 22:49
 */
import React from 'react';
import Loading from './Loading';
export var LoadingWarp = function LoadingWarp(Component) {
  return (
    /*#__PURE__*/
    function (_React$Component) {
      _inherits(_class, _React$Component);

      function _class() {
        _classCallCheck(this, _class);

        return _possibleConstructorReturn(this, _getPrototypeOf(_class).apply(this, arguments));
      }

      _createClass(_class, [{
        key: "render",
        value: function render() {
          var _this$props = this.props,
              loading = _this$props.loading,
              other = _objectWithoutProperties(_this$props, ["loading"]);

          return React.createElement(Loading, {
            show: !!loading
          }, React.createElement(Component, other));
        }
      }]);

      return _class;
    }(React.Component)
  );
};
export default Loading;