"use strict";

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

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

var _reactRouterDom = require("react-router-dom");

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

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

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

var DocReferenceItems = (heading, items, api, specKey, pattern) => {
  if (items.length === 0) return _react.default.createElement(_react.default.Fragment, null);
  return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_runIt.RunItHeading, {
    as: "h4"
  }, heading), items.map((item, index) => _react.default.createElement("span", {
    className: "doc-link",
    key: item.name
  }, index ? ', ' : '', _react.default.createElement(_reactRouterDom.Link, {
    to: (0, _utils.buildPath)(api, item, specKey)
  }, (0, _utils.highlightHTML)(pattern, item.name)))));
};

exports.DocReferenceItems = DocReferenceItems;
//# sourceMappingURL=utils.js.map