'use strict';

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

exports.default = ExpertCard;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

require('./ExpertCard.css');

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _xor = require('lodash/xor');

var _xor2 = _interopRequireDefault(_xor);

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

function ExpertCard(props) {
  return _react2.default.createElement(
    'div',
    { className: (0, _classnames2.default)(props.className, 'expert-card__container') },
    props.children
  );
}
ExpertCard.propTypes = {
  children: function children(props, propName, componentName) {
    var childrenTypes = props[propName].map(function (el) {
      return el.type.name;
    });
    var allowedTypes = [ExpertCard.Header.name, ExpertCard.Configure.name, ExpertCard.Content.name];

    // Only accept a single child, of the appropriate type
    if ((0, _xor2.default)(childrenTypes, allowedTypes).length) {
      return new Error(['`' + componentName + '`', 'should have exactly 3 children of the following types: ', ' `' + allowedTypes.join('`, `') + '`'].join(' '));
    }
  }
};

ExpertCard.Header = function ExpertCardHeader(props) {
  return _react2.default.createElement(
    'div',
    _extends({}, props, { className: (0, _classnames2.default)(props.className, 'expert-card__header') }),
    props.children
  );
};

ExpertCard.Configure = function ExpertCardConfigure(props) {
  return _react2.default.createElement(
    'div',
    _extends({}, props, { className: (0, _classnames2.default)(props.className, 'expert-card__configure') }),
    props.children
  );
};

ExpertCard.Content = function ExpertCardContent(props) {
  return _react2.default.createElement(
    'div',
    _extends({}, props, { className: (0, _classnames2.default)(props.className, 'expert-card__content') }),
    props.children
  );
};
//# sourceMappingURL=ExpertCard.js.map