import { Cross } from '@transferwise/icons';
import { clsx } from 'clsx';
import SentimentSurface from '../../sentimentSurface/SentimentSurface.mjs';
import IconButton from '../../iconButton/IconButton.mjs';
import { useIntl } from 'react-intl';
import closeBtnMessages from '../../common/closeButton/CloseButton.messages.mjs';
import { jsx, jsxs } from 'react/jsx-runtime';

const PrimitivePrompt = ({
  sentiment = 'success',
  media,
  actions,
  onDismiss,
  className,
  children,
  ...restProps
}) => {
  const intl = useIntl();
  return /*#__PURE__*/jsx(SentimentSurface, {
    sentiment: sentiment,
    className: clsx('wds-prompt', `wds-prompt--${sentiment}`, className),
    ...restProps,
    children: /*#__PURE__*/jsxs("div", {
      className: clsx('wds-prompt__content-wrapper', {
        'wds-prompt__content-wrapper--with-dismiss': !!onDismiss
      }),
      children: [/*#__PURE__*/jsx("div", {
        className: clsx('wds-prompt__media-wrapper'),
        children: media
      }), children, onDismiss && /*#__PURE__*/jsx(IconButton, {
        size: 24,
        priority: "secondary",
        "aria-label": intl.formatMessage(closeBtnMessages.ariaLabel),
        onClick: onDismiss,
        children: /*#__PURE__*/jsx(Cross, {})
      }), actions && /*#__PURE__*/jsx("div", {
        className: "wds-prompt__actions-wrapper",
        children: actions
      })]
    })
  });
};

export { PrimitivePrompt };
//# sourceMappingURL=PrimitivePrompt.mjs.map
