import React from 'react';
import cx from 'classnames';

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

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

  return /*#__PURE__*/React.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;
export { SectionWrapper as Section };