"use strict";

exports.__esModule = true;
exports["default"] = exports.Container = void 0;
var _react = _interopRequireDefault(require("react"));
var _flex = _interopRequireDefault(require("../../../components/templates/flex"));
var _typography = require("../../../components/typography");
var _icon = require("../../../components/icon");
var _excluded = ["title", "children", "topBorder"];
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
var borderProps = {
  border: {
    side: "top",
    color: "disabled"
  },
  padding: [6, 0, 0]
};
var Section = function Section(_ref) {
  var title = _ref.title,
    children = _ref.children,
    _ref$topBorder = _ref.topBorder,
    topBorder = _ref$topBorder === void 0 ? true : _ref$topBorder,
    rest = _objectWithoutPropertiesLoose(_ref, _excluded);
  return /*#__PURE__*/_react["default"].createElement(_flex["default"], _extends({
    column: true
  }, topBorder && borderProps, rest), /*#__PURE__*/_react["default"].createElement(_flex["default"], {
    margin: [0, 0, 2],
    gap: 2
  }, /*#__PURE__*/_react["default"].createElement(_icon.Icon, {
    name: "insights",
    color: "text",
    width: "18px",
    height: "18px"
  }), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
    strong: true
  }, title)), typeof children === "string" ? /*#__PURE__*/_react["default"].createElement(_typography.Text, null, children) : children);
};
var Container = exports.Container = function Container(props) {
  return /*#__PURE__*/_react["default"].createElement(_flex["default"], _extends({
    overflow: {
      vertical: "auto"
    },
    padding: [6, 4],
    gap: 6,
    column: true
  }, props));
};
var _default = exports["default"] = Section;