"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ListWithTitles = void 0;
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _react = _interopRequireDefault(require("react"));
var _ = require("../..");
var _excluded = ["leftTitle", "rightTitle", "className"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
var TitleContainer = _styledComponents.default.div.withConfig({
  displayName: "ListWithTitles__TitleContainer",
  componentId: "sc-1mk4x8k-0"
})(["margin-bottom:", "px;"], function (p) {
  return p.theme.spacing.unit(1);
});
var ListWithTitles = exports.ListWithTitles = function ListWithTitles(props) {
  var leftTitle = props.leftTitle,
    rightTitle = props.rightTitle,
    className = props.className,
    restProps = _objectWithoutProperties(props, _excluded);
  return leftTitle || rightTitle ? _react.default.createElement("div", {
    className: className
  }, _react.default.createElement(TitleContainer, null, _react.default.createElement(_.Flexbox, {
    container: true,
    gap: 0,
    justifyContent: "space-between"
  }, _react.default.createElement(_.Flexbox, {
    item: true
  }, _react.default.createElement(_.Typography, {
    type: "secondary",
    color: function color(t) {
      return t.color.label;
    }
  }, leftTitle)), _react.default.createElement(_.Flexbox, {
    item: true
  }, _react.default.createElement(_.Typography, {
    type: "secondary",
    color: function color(t) {
      return t.color.label;
    }
  }, rightTitle)))), _react.default.createElement(_.List, restProps)) : _react.default.createElement(_.List, _extends({
    className: className
  }, restProps));
};
ListWithTitles.displayName = 'ListWithTitles';