/* 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';
const styles = {
  sectionTitleOld: "_11c8i4vh _1q511b66",
  sectionTitle: "_11c8i4vh _syazazsu _1q511b66",
  boxStyle: "_11c8wadc _1rjcu2gc"
};
const RelatedLinksList = ({
  urls,
  title,
  testId,
  selected,
  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((url, idx) => /*#__PURE__*/React.createElement(Stack, {
    key: `${idx}-${url}`
  }, /*#__PURE__*/React.createElement(RelatedLinkItem, {
    url: url,
    testId: `${testId}-item-${idx}`,
    isSelected: selected === `${idx}-${url}`,
    onFocus: () => handleSelectedUpdate && handleSelectedUpdate(`${idx}-${url}`)
  })))), urls.length === 0 && /*#__PURE__*/React.createElement(Box, {
    xcss: styles.boxStyle
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_not_found)));
};
export default RelatedLinksList;