"use strict";

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

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

var _runIt = require("@looker/run-it");

var _reactRedux = require("react-redux");

var _state = require("../../state");

var _utils = require("./utils");

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

var DocReferences = _ref => {
  var {
    typesUsed,
    specKey,
    api,
    methodsUsedBy = [],
    typesUsedBy = []
  } = _ref;
  var searchPattern = (0, _reactRedux.useSelector)(_state.selectSearchPattern);
  if (typesUsed.length === 0 && methodsUsedBy.length === 0 && typesUsedBy.length === 0) return _react.default.createElement(_react.default.Fragment, null);
  return _react.default.createElement(_runIt.CollapserCard, {
    heading: "References",
    id: "references"
  }, _react.default.createElement(_react.default.Fragment, null, (0, _utils.DocReferenceItems)('Referenced Types:', typesUsed, api, specKey, searchPattern), (0, _utils.DocReferenceItems)('Used by types:', typesUsedBy, api, specKey, searchPattern), (0, _utils.DocReferenceItems)('Used by methods:', methodsUsedBy, api, specKey, searchPattern)));
};

exports.DocReferences = DocReferences;
//# sourceMappingURL=DocReferences.js.map