import React from 'react';
import { FormattedMessage } from 'react-intl';
import { di } from 'react-magnetic-di';
import AIIcon from '@atlaskit/icon/core/atlassian-intelligence';
import { Box, Inline } from '@atlaskit/primitives/compiled';
import Tooltip from '@atlaskit/tooltip';
import { messages } from '../../../../../../messages';
import useAISummaryAction from '../../../../../../state/hooks/use-ai-summary-action';
import { InfoIcon } from '../icons/info';
export var AIFooterMetadata = function AIFooterMetadata(_ref) {
  var testId = _ref.testId,
    url = _ref.url;
  var _useAISummaryAction = useAISummaryAction(url),
    status = _useAISummaryAction.state.status;
  if (status !== 'done') {
    return null;
  }
  return /*#__PURE__*/React.createElement(Inline, {
    space: "space.100",
    testId: testId,
    alignInline: "end",
    grow: "fill"
  }, /*#__PURE__*/React.createElement(Tooltip, {
    content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarized_info_short),
    position: "bottom"
  }, function (tooltipProps) {
    return /*#__PURE__*/React.createElement(Box, tooltipProps, /*#__PURE__*/React.createElement(InfoIcon, {
      label: "Information",
      color: "var(--ds-icon-subtle, #505258)"
    }));
  }), /*#__PURE__*/React.createElement(AIIcon, {
    label: "AI",
    color: "var(--ds-icon-subtle, #505258)"
  }));
};