"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _react = _interopRequireDefault(require("react"));
var _analyticsNext = require("@atlaskit/analytics-next");
var _compiled = require("@atlaskit/primitives/compiled");
var _messages = require("../../../../messages");
var _relatedLinksList = _interopRequireDefault(require("../../components/related-links-list"));
var RelatedLinksResolvedView = function RelatedLinksResolvedView(_ref) {
  var _ref$incomingLinks = _ref.incomingLinks,
    incomingLinks = _ref$incomingLinks === void 0 ? [] : _ref$incomingLinks,
    _ref$outgoingLinks = _ref.outgoingLinks,
    outgoingLinks = _ref$outgoingLinks === void 0 ? [] : _ref$outgoingLinks;
  var _React$useState = _react.default.useState(''),
    _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
    selected = _React$useState2[0],
    setSelected = _React$useState2[1];
  var handleSelectedUpdate = function handleSelectedUpdate(selectedKey) {
    setSelected(selectedKey);
  };
  return /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
    space: "space.150"
  }, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
    data: {
      component: 'relatedLinksIncoming'
    }
  }, /*#__PURE__*/_react.default.createElement(_relatedLinksList.default, {
    urls: incomingLinks,
    title: _messages.messages.related_links_found_in,
    testId: "incoming-related-links-list",
    selected: selected,
    handleSelectedUpdate: handleSelectedUpdate
  })), /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
    data: {
      component: 'relatedLinksOutgoing'
    }
  }, /*#__PURE__*/_react.default.createElement(_relatedLinksList.default, {
    urls: outgoingLinks,
    title: _messages.messages.related_links_includes_links_to,
    testId: "outgoing-related-links-list",
    selected: selected,
    handleSelectedUpdate: handleSelectedUpdate
  })));
};
var _default = exports.default = RelatedLinksResolvedView;