/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
require("./index.compiled.css");
var React = _interopRequireWildcard(require("react"));
var _runtime = require("@compiled/react/runtime");
var _reactIntlNext = require("react-intl-next");
var _compiled = require("@atlaskit/primitives/compiled");
var _messages = require("../../../../messages");
var _relatedLinkItem = _interopRequireDefault(require("../related-link-item"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
  sectionTitleOld: "_11c8i4vh _1q511b66",
  sectionTitle: "_11c8i4vh _syazazsu _1q511b66",
  boxStyle: "_11c8wadc _1rjcu2gc"
};
var RelatedLinksList = function RelatedLinksList(_ref) {
  var urls = _ref.urls,
    title = _ref.title,
    testId = _ref.testId,
    selected = _ref.selected,
    handleSelectedUpdate = _ref.handleSelectedUpdate;
  return /*#__PURE__*/React.createElement(_compiled.Stack, {
    testId: testId
  }, /*#__PURE__*/React.createElement(_compiled.Box, {
    xcss: styles.sectionTitle
  }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, title)), urls.length > 0 && /*#__PURE__*/React.createElement(_compiled.Box, null, urls.map(function (url, idx) {
    return /*#__PURE__*/React.createElement(_compiled.Stack, {
      key: "".concat(idx, "-").concat(url)
    }, /*#__PURE__*/React.createElement(_relatedLinkItem.default, {
      url: url,
      testId: "".concat(testId, "-item-").concat(idx),
      isSelected: selected === "".concat(idx, "-").concat(url),
      onFocus: function onFocus() {
        return handleSelectedUpdate && handleSelectedUpdate("".concat(idx, "-").concat(url));
      }
    }));
  })), urls.length === 0 && /*#__PURE__*/React.createElement(_compiled.Box, {
    xcss: styles.boxStyle
  }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _messages.messages.related_links_not_found)));
};
var _default = exports.default = RelatedLinksList;