import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var _jsxFileName = 'src/loading/index.js';
/**
 * index.js
 *
 * @Author: apple
 * @Date: 2018/1/22 22:49
 */

import React from 'react';
import Loading from './Loading';

var LoadingWarp = function LoadingWarp(Component) {
    return function (_React$Component) {
        _inherits(_class, _React$Component);

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

            return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
        }

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

                return React.createElement(
                    Loading,
                    { show: !!loading, __source: {
                            fileName: _jsxFileName,
                            lineNumber: 16
                        },
                        __self: this
                    },
                    React.createElement(Component, Object.assign({}, other, {
                        __source: {
                            fileName: _jsxFileName,
                            lineNumber: 17
                        },
                        __self: this
                    }))
                );
            }
        }]);

        return _class;
    }(React.Component);
};

export { LoadingWarp };
export default Loading;