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 { forwardRef } from 'react';
import { jsx, jsxs } from 'react/jsx-runtime';

const PrimitivePrompt = /*#__PURE__*/forwardRef(({
  sentiment = 'success',
  emphasis = 'base',
  media,
  actions,
  onDismiss,
  className,
  children,
  ...restProps
}, ref) => {
  const intl = useIntl();
  return /*#__PURE__*/jsx(SentimentSurface
  // @ts-expect-error - SentimentSurface forwardRef types don't expose ref in props
  , {
    ref: ref,
    sentiment: sentiment,
    emphasis: emphasis,
    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
      })]
    })
  });
});
PrimitivePrompt.displayName = 'PrimitivePrompt';

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