import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import React from 'react';
import { ResponsiveLayout } from "../ResponsiveLayout";
export function responsiveLayout(WrappedComp) {
  var ComponentWithLayout = /*#__PURE__*/function (_WrappedComp) {
    function ComponentWithLayout() {
      var _this;
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _WrappedComp.call.apply(_WrappedComp, [this].concat(args)) || this;
      _this.renderWithLayout = function (currentLayout) {
        _this.layout = currentLayout;
        return _WrappedComp.prototype.render.call(_this);
      };
      return _this;
    }
    _inheritsLoose(ComponentWithLayout, _WrappedComp);
    var _proto = ComponentWithLayout.prototype;
    _proto.render = function render() {
      return /*#__PURE__*/React.createElement(ResponsiveLayout, null, this.renderWithLayout);
    };
    return _createClass(ComponentWithLayout, [{
      key: "currentLayout",
      get: function get() {
        return this.layout;
      },
      set: function set(value) {//
      }
    }, {
      key: "isMobileLayout",
      get: function get() {
        return this.layout.isMobile;
      },
      set: function set(value) {//
      }
    }]);
  }(WrappedComp);
  var nameDescriptor = Object.getOwnPropertyDescriptor(ComponentWithLayout, 'name');
  if (!nameDescriptor || nameDescriptor.configurable) {
    Object.defineProperty(ComponentWithLayout, 'name', {
      value: WrappedComp.name
    });
  }
  return ComponentWithLayout;
}