/* index.tsx generated by @compiled/babel-plugin v0.40.0 */
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { FormattedMessage } from 'react-intl';
import { Box, Stack } from '@atlaskit/primitives/compiled';
import { messages } from '../../../../messages';
import RelatedLinkItem from '../related-link-item';
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(Stack, {
    testId: testId
  }, /*#__PURE__*/React.createElement(Box, {
    xcss: styles.sectionTitle
  }, /*#__PURE__*/React.createElement(FormattedMessage, title)), urls.length > 0 && /*#__PURE__*/React.createElement(Box, null, urls.map(function (url, idx) {
    return /*#__PURE__*/React.createElement(Stack, {
      key: "".concat(idx, "-").concat(url)
    }, /*#__PURE__*/React.createElement(RelatedLinkItem, {
      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(Box, {
    xcss: styles.boxStyle
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_not_found)));
};
export default RelatedLinksList;