'use strict';

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

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

exports.default = Card;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _CardContent = require('./CardContent');

var _CardContent2 = _interopRequireDefault(_CardContent);

var _CardWrapper = require('./CardWrapper');

var _CardWrapper2 = _interopRequireDefault(_CardWrapper);

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

function Card(_ref) {
  var children = _ref.children,
      wrapped = _ref.wrapped,
      wrapperClassName = _ref.wrapperClassName,
      props = (0, _objectWithoutProperties3.default)(_ref, ['children', 'wrapped', 'wrapperClassName']);

  var card = _react2.default.createElement(
    _CardContent2.default,
    props,
    children
  );
  return wrapped ? _react2.default.createElement(
    _CardWrapper2.default,
    { className: wrapperClassName },
    card
  ) : card;
}

Card.propTypes = {
  children: _propTypes2.default.node.isRequired,
  className: _propTypes2.default.string,
  wrapperClassName: _propTypes2.default.string,
  wrapped: _propTypes2.default.bool
};

Card.defaultProps = {
  wrapped: false,
  className: null,
  wrapperClassName: null
};