import { Flag } from '@wise/art';
import { clsx } from 'clsx';
import { cloneElement } from 'react';
import Body from '../../body/Body.mjs';
import '../../common/theme.mjs';
import '../../common/direction.mjs';
import '../../common/propsValues/control.mjs';
import '../../common/propsValues/breakpoint.mjs';
import '../../common/propsValues/size.mjs';
import { Typography } from '../../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 '../../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/icons';
import 'react-intl';
import '../../common/closeButton/CloseButton.messages.mjs';
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';

function Option({
  label,
  currency = '',
  note = '',
  secondary = '',
  icon,
  selected = false,
  testId
}) {
  const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
    size: 24,
    className: 'tw-icon'
  }) : currency && /*#__PURE__*/jsx(Flag, {
    code: currency.toLowerCase(),
    intrinsicSize: 24
  });
  const titleAndNoteElement = /*#__PURE__*/jsxs(Body, {
    as: "span",
    type: Typography.BODY_LARGE,
    className: selected ? 'text-ellipsis' : undefined,
    children: [label, note && /*#__PURE__*/jsx(Body, {
      as: "span",
      className: "m-l-1",
      children: note
    })]
  });
  const secondaryElement = secondary && /*#__PURE__*/jsx(Body, {
    className: clsx(selected && 'text-ellipsis'),
    children: secondary
  });
  return iconElement ? /*#__PURE__*/jsxs("div", {
    className: "d-flex np-option-content",
    "data-testid": testId,
    children: [/*#__PURE__*/jsx("div", {
      className: `d-flex flex-column${selected ? ' justify-content-center' : ''}`,
      children: iconElement
    }), /*#__PURE__*/jsxs("div", {
      className: "d-flex flex-column justify-content-center",
      children: [titleAndNoteElement, secondaryElement]
    })]
  }) : /*#__PURE__*/jsxs(Fragment, {
    children: [iconElement, titleAndNoteElement, secondaryElement]
  });
}

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