import React from 'react';
import { CollapserCard } from '@looker/run-it';
import { useSelector } from 'react-redux';
import { selectSearchPattern } from '../../state';
import { DocReferenceItems } from './utils';
export var DocReferences = _ref => {
  var {
    typesUsed,
    specKey,
    api,
    methodsUsedBy = [],
    typesUsedBy = []
  } = _ref;
  var searchPattern = useSelector(selectSearchPattern);
  if (typesUsed.length === 0 && methodsUsedBy.length === 0 && typesUsedBy.length === 0) return React.createElement(React.Fragment, null);
  return React.createElement(CollapserCard, {
    heading: "References",
    id: "references"
  }, React.createElement(React.Fragment, null, DocReferenceItems('Referenced Types:', typesUsed, api, specKey, searchPattern), DocReferenceItems('Used by types:', typesUsedBy, api, specKey, searchPattern), DocReferenceItems('Used by methods:', methodsUsedBy, api, specKey, searchPattern)));
};
//# sourceMappingURL=DocReferences.js.map