import React from 'react';
import { FormattedMessage } from 'react-intl';
import { ActionName } from '../../../constants';
import { messages } from '../../../messages';
/**
 * Returns a CustomActionItem with a "Retry" default message
 *
 * @see CustomActionItem
 * @param onRetry a function that will be called on the click of the "Retry" button
 */
export const RetryAction = onRetry => ({
  name: ActionName.CustomAction,
  onClick: onRetry,
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again),
  testId: 'smart-action-try-again'
});