import React from 'react';
import { AnalyticsContext } from '@atlaskit/analytics-next';
import { Stack } from '@atlaskit/primitives/compiled';
import { messages } from '../../../../messages';
import RelatedLinksList from '../../components/related-links-list';
const RelatedLinksResolvedView = ({
  incomingLinks = [],
  outgoingLinks = []
}) => {
  const [selected, setSelected] = React.useState('');
  const handleSelectedUpdate = selectedKey => {
    setSelected(selectedKey);
  };
  return /*#__PURE__*/React.createElement(Stack, {
    space: "space.150"
  }, /*#__PURE__*/React.createElement(AnalyticsContext, {
    data: {
      component: 'relatedLinksIncoming'
    }
  }, /*#__PURE__*/React.createElement(RelatedLinksList, {
    urls: incomingLinks,
    title: messages.related_links_found_in,
    testId: "incoming-related-links-list",
    selected: selected,
    handleSelectedUpdate: handleSelectedUpdate
  })), /*#__PURE__*/React.createElement(AnalyticsContext, {
    data: {
      component: 'relatedLinksOutgoing'
    }
  }, /*#__PURE__*/React.createElement(RelatedLinksList, {
    urls: outgoingLinks,
    title: messages.related_links_includes_links_to,
    testId: "outgoing-related-links-list",
    selected: selected,
    handleSelectedUpdate: handleSelectedUpdate
  })));
};
export default RelatedLinksResolvedView;