'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _CreateAccordion = require('./CreateAccordion');

var _CreateAccordion2 = _interopRequireDefault(_CreateAccordion);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var getDisplayName = function getDisplayName(WrappedComponent) {
	return WrappedComponent.displayName || WrappedComponent.name || 'Component';
};
// decorator

exports.default = function () {
	var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
	return function (WrappedComponent) {
		var CreateDecorated = function (_Component) {
			(0, _inherits3.default)(CreateDecorated, _Component);

			function CreateDecorated() {
				(0, _classCallCheck3.default)(this, CreateDecorated);

				var _this = (0, _possibleConstructorReturn3.default)(this, (CreateDecorated.__proto__ || Object.getPrototypeOf(CreateDecorated)).call(this));

				_this.displayName = 'CreateAccordion' + getDisplayName(WrappedComponent);
				return _this;
			}

			(0, _createClass3.default)(CreateDecorated, [{
				key: 'render',
				value: function render() {
					return _react2.default.createElement(
						_CreateAccordion2.default,
						options,
						_react2.default.createElement(WrappedComponent, (0, _extends3.default)({}, this.props, { ref: 'WrappedComponent' }))
					);
				}
			}]);
			return CreateDecorated;
		}(_react.Component);

		;
		var staticObj = options.staticObj;

		if (staticObj) {
			for (var key in staticObj) {
				CreateDecorated[key] = staticObj[key];
			}
		}
		return CreateDecorated;
	};
};