'use strict';

var icons = require('@transferwise/icons');
var clsx = require('clsx');
var avatarTypes = require('../avatar/avatarTypes.js');
var Avatar = require('../avatar/Avatar.js');
var Body = require('../body/Body.js');
var jsxRuntime = require('react/jsx-runtime');
var typography = require('../common/propsValues/typography.js');

const PromoCardIndicator = ({
  className,
  children,
  label,
  icon,
  isSmall = false,
  testid,
  ...rest
}) => {
  const isIconString = icon && typeof icon === 'string';
  const IconComponent = isIconString && {
    check: icons.Check,
    arrow: icons.ArrowRight,
    download: icons.Download
  }[icon];
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
    className: clsx.clsx('np-Card-indicator', className),
    "data-testid": testid,
    ...rest,
    children: [label && /*#__PURE__*/jsxRuntime.jsx(Body, {
      as: "span",
      type: typography.Typography.BODY_LARGE_BOLD,
      className: "np-Card-indicatorText",
      children: label
    }), icon && /*#__PURE__*/jsxRuntime.jsx(Avatar, {
      type: avatarTypes.AvatarType.ICON,
      size: isSmall ? 40 : 56,
      backgroundColor: "var(--Card-indicator-icon-background-color)",
      className: "np-Card-indicatorIcon",
      children: IconComponent ? /*#__PURE__*/jsxRuntime.jsx(IconComponent, {
        size: 24,
        "aria-hidden": "true"
      }) : icon
    }), children]
  });
};

module.exports = PromoCardIndicator;
//# sourceMappingURL=PromoCardIndicator.js.map
