"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

require("core-js/modules/es.symbol");

require("core-js/modules/es.symbol.description");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _suitCx = _interopRequireDefault(require("suit-cx"));

var propTypes = {
  /**
   * Header of the chapter
   */
  header: _propTypes.default.string,

  /**
  * Description of the chapter
  */
  description: _propTypes.default.string,

  /**
   * Whether or not the chapter should have a dark background
   */
  dark: _propTypes.default.bool
};
var defaultProps = {
  header: null,
  description: null,
  dark: false
};

function Chapter(_ref) {
  var header = _ref.header,
      description = _ref.description,
      style = _ref.style,
      dark = _ref.dark,
      children = _ref.children,
      className = _ref.className,
      rest = (0, _objectWithoutProperties2.default)(_ref, ["header", "description", "style", "dark", "children", "className"]);
  var classes = (0, _suitCx.default)({
    name: 'Chapter',
    modifiers: ['dark']
  }, {
    dark: dark
  }, className);
  return _react.default.createElement("div", {
    style: style,
    className: classes()
  }, header ? _react.default.createElement("header", null, _react.default.createElement("h2", {
    className: classes('header')
  }, header)) : null, description ? _react.default.createElement("div", {
    className: classes('description')
  }, description) : null, _react.default.createElement("div", {
    className: classes('content')
  }, children));
}

Chapter.propTypes = propTypes;
Chapter.defaultProps = defaultProps;
var _default = Chapter;
exports.default = _default;
module.exports = exports.default;