import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { getAISummaryErrorMessage } from '../../../../../utils/ai-summary';
import AIEventErrorViewed from '../../common/ai-summary/ai-event-error-viewed';
import AILearnMoreAnchor from '../../common/ai-summary/ai-learn-more-anchor';
export var getErrorMessage = function getErrorMessage(error) {
  var _getAISummaryErrorMes = getAISummaryErrorMessage(error),
    message = _getAISummaryErrorMes.message,
    url = _getAISummaryErrorMes.url;
  return {
    appearance: 'error',
    title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
      reason: error
    }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
      values: {
        a: function a(chunks) {
          return /*#__PURE__*/React.createElement(AILearnMoreAnchor, {
            href: url
          }, chunks);
        }
      }
    })))
  };
};