"use strict";

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

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

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

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

var _styles = require("@material-ui/core/styles");

var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));

var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));

var useStyles = function useStyles(props) {
  return (0, _styles.makeStyles)(function (theme) {
    return {
      root: {
        width: "100%",
        paddingTop: theme.spacing(2),
        paddingBottom: theme.spacing(2)
      }
    };
  });
};

function ContentBlock(_ref) {
  var children = _ref.children,
      props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
  var classes = useStyles(props)();
  var classNames = "".concat(classes.root, " ").concat(props.className);
  return /*#__PURE__*/_react.default.createElement(_Grid.default, Object.assign({}, props, {
    className: classNames,
    direction: "column",
    container: true,
    spacing: 1
  }), props.title ? /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true,
    container: true
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, null, /*#__PURE__*/_react.default.createElement("strong", null, props.title))) : null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
    item: true,
    container: true
  }, children));
}

var _default = ContentBlock;
exports.default = _default;