"use strict";

exports.__esModule = true;
exports.Section = void 0;

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

var _classnames = _interopRequireDefault(require("classnames"));

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

var Section = function Section(_ref) {
  var background = _ref.background,
      dark = _ref.dark,
      header = _ref.header,
      children = _ref.children;
  var classes = (0, _classnames.default)('block ', dark && 'dark', background && "bg-" + background);

  var contentHeader = function contentHeader() {
    return header && /*#__PURE__*/_react.default.createElement("div", {
      className: "header"
    }, /*#__PURE__*/_react.default.createElement("h2", {
      className: "title"
    }, header));
  };

  return /*#__PURE__*/_react.default.createElement("section", {
    className: classes
  }, contentHeader(), children);
};

Section.displayName = 'section';
var SectionDoc;

if (process.env.NODE_ENV !== 'production') {
  // eslint-disable-next-line global-require
  SectionDoc = require('./doc').doc(Section);
}

var SectionWrapper = SectionDoc || Section;
exports.Section = SectionWrapper;