"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AIFooterMetadata = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactIntl = require("react-intl");
var _reactMagneticDi = require("react-magnetic-di");
var _atlassianIntelligence = _interopRequireDefault(require("@atlaskit/icon/core/atlassian-intelligence"));
var _compiled = require("@atlaskit/primitives/compiled");
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
var _messages = require("../../../../../../messages");
var _useAiSummaryAction = _interopRequireDefault(require("../../../../../../state/hooks/use-ai-summary-action"));
var _info = require("../icons/info");
var AIFooterMetadata = exports.AIFooterMetadata = function AIFooterMetadata(_ref) {
  var testId = _ref.testId,
    url = _ref.url;
  var _useAISummaryAction = (0, _useAiSummaryAction.default)(url),
    status = _useAISummaryAction.state.status;
  if (status !== 'done') {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
    space: "space.100",
    testId: testId,
    alignInline: "end",
    grow: "fill"
  }, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
    content: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.ai_summarized_info_short),
    position: "bottom"
  }, function (tooltipProps) {
    return /*#__PURE__*/_react.default.createElement(_compiled.Box, tooltipProps, /*#__PURE__*/_react.default.createElement(_info.InfoIcon, {
      label: "Information",
      color: "var(--ds-icon-subtle, #505258)"
    }));
  }), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
    label: "AI",
    color: "var(--ds-icon-subtle, #505258)"
  }));
};