'use strict';

var icons = require('@transferwise/icons');
var AvatarView = require('../../avatarView/AvatarView.js');
var Image = require('../../image/Image.js');
var StatusIcon = require('../../statusIcon/StatusIcon.js');
var jsxRuntime = require('react/jsx-runtime');

function renderPromptMedia({
  media,
  sentiment,
  mediaId,
  imgClassName
}) {
  if (media?.imgSrc) {
    return /*#__PURE__*/jsxRuntime.jsx(Image.default, {
      id: mediaId,
      src: media.imgSrc,
      className: imgClassName,
      alt: media['aria-label'] ?? ''
    });
  }
  if (media?.avatar) {
    const badge = media.avatar.badge ? media.avatar.badge : sentiment === 'proposition' ? {} : {
      status: sentiment
    };
    return /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
      ...media.avatar,
      badge: badge,
      "aria-label": media['aria-label'],
      "aria-hidden": media['aria-hidden'],
      id: mediaId,
      size: 48,
      children: media.avatar.asset
    });
  }
  return sentiment === 'proposition' ? /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
    id: mediaId,
    size: 48,
    "aria-label": media['aria-label'],
    "aria-hidden": media['aria-hidden'],
    children: /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {})
  }) : /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
    id: mediaId,
    size: 48,
    sentiment: sentiment,
    iconLabel: media['aria-hidden'] ? null : media['aria-label']
  });
}

exports.renderPromptMedia = renderPromptMedia;
//# sourceMappingURL=promptMedia.js.map
