import { ClockBorderless, Alert } from '@transferwise/icons';
import { clsx } from 'clsx';
import Alert$1 from '../alert/Alert.mjs';
import '../common/theme.mjs';
import '../common/direction.mjs';
import '@transferwise/neptune-tokens';
import '../common/propsValues/control.mjs';
import '../common/propsValues/size.mjs';
import '../common/propsValues/typography.mjs';
import '../common/propsValues/width.mjs';
import '../common/propsValues/type.mjs';
import '../common/propsValues/dateMode.mjs';
import '../common/propsValues/monthFormat.mjs';
import '../common/propsValues/position.mjs';
import '../common/propsValues/layouts.mjs';
import '../common/propsValues/status.mjs';
import { Sentiment } from '../common/propsValues/sentiment.mjs';
import '../common/propsValues/profileType.mjs';
import '../common/propsValues/variant.mjs';
import '../common/propsValues/scroll.mjs';
import '../common/propsValues/markdownNodeType.mjs';
import '../common/fileType.mjs';
import '@transferwise/formatting';
import 'react';
import 'react-intl';
import '../common/closeButton/CloseButton.messages.mjs';
import { jsx } from 'react/jsx-runtime';
import Circle from '../common/circle/Circle.mjs';
import SentimentSurface from '../sentimentSurface/SentimentSurface.mjs';

const makeSurface = sentiment => {
  const Surface = props => /*#__PURE__*/jsx(SentimentSurface, {
    as: "span",
    emphasis: "elevated",
    sentiment: sentiment,
    ...props
  });
  Surface.displayName = `CriticalCommsSurface(${sentiment})`;
  return Surface;
};
const iconBySentiment = {
  [Sentiment.NEGATIVE]: /*#__PURE__*/jsx(Circle, {
    as: makeSurface(Sentiment.NEGATIVE),
    size: 32,
    className: "status-circle negative",
    children: /*#__PURE__*/jsx(Alert, {
      className: "status-icon light"
    })
  }),
  [Sentiment.WARNING]: /*#__PURE__*/jsx(Circle, {
    as: makeSurface(Sentiment.WARNING),
    size: 32,
    className: "status-circle warning",
    children: /*#__PURE__*/jsx(Alert, {
      className: "status-icon dark"
    })
  }),
  [Sentiment.NEUTRAL]: /*#__PURE__*/jsx(Circle, {
    as: makeSurface(Sentiment.NEUTRAL),
    size: 32,
    className: "status-circle neutral",
    children: /*#__PURE__*/jsx(ClockBorderless, {
      className: "status-icon dark"
    })
  })
};
/**
 * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.
 */
function CriticalCommsBanner({
  title,
  subtitle,
  action,
  sentiment = Sentiment.NEGATIVE,
  className
}) {
  return /*#__PURE__*/jsx(SentimentSurface, {
    sentiment: sentiment,
    emphasis: "elevated",
    className: clsx('critical-comms', className),
    children: /*#__PURE__*/jsx(Alert$1, {
      title: title,
      message: subtitle,
      action: action && {
        onClick: action.onClick,
        href: action.href,
        target: action.target,
        text: action.label,
        as: 'button'
      },
      className: className,
      type: sentiment,
      icon: iconBySentiment[sentiment]
    })
  });
}

export { CriticalCommsBanner as default };
//# sourceMappingURL=CriticalCommsBanner.mjs.map
