"use strict";

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _immutable = _interopRequireDefault(require("immutable"));

var _SearchResultBatchPanelContainer = _interopRequireDefault(require("../../containers/search/SearchResultBatchPanelContainer"));

var _SearchResultReportPanelContainer = _interopRequireDefault(require("../../containers/search/SearchResultReportPanelContainer"));

var _SearchResultSidebar = _interopRequireDefault(require("../../../styles/cspace-ui/SearchResultSidebar.css"));

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

const panelColor = 'black';
const propTypes = {
  config: _propTypes.default.shape({
    recordTypes: _propTypes.default.object
  }),
  history: _propTypes.default.shape({
    push: _propTypes.default.func
  }),
  recordType: _propTypes.default.string,
  isOpen: _propTypes.default.bool,
  selectedItems: _propTypes.default.instanceOf(_immutable.default.Map)
};
const defaultProps = {
  isOpen: true
};

function SearchResultSidebar(props) {
  const {
    config,
    history,
    recordType,
    isOpen,
    selectedItems
  } = props;

  if (!isOpen) {
    return null;
  }

  return /*#__PURE__*/_react.default.createElement("div", {
    className: _SearchResultSidebar.default.common
  }, /*#__PURE__*/_react.default.createElement(_SearchResultReportPanelContainer.default, {
    color: panelColor,
    config: config,
    recordType: recordType,
    selectedItems: selectedItems
  }), /*#__PURE__*/_react.default.createElement(_SearchResultBatchPanelContainer.default, {
    color: panelColor,
    config: config,
    history: history,
    recordType: recordType,
    selectedItems: selectedItems
  }));
}

SearchResultSidebar.propTypes = propTypes;
SearchResultSidebar.defaultProps = defaultProps;