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 const getErrorMessage = error => {
  const {
    message,
    url
  } = getAISummaryErrorMessage(error);
  return {
    appearance: 'error',
    title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AIEventErrorViewed, {
      reason: error
    }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
      values: {
        a: chunks => /*#__PURE__*/React.createElement(AILearnMoreAnchor, {
          href: url
        }, chunks)
      }
    })))
  };
};