'use strict';

var art = require('@wise/art');
var clsx = require('clsx');
var React = require('react');
var Body = require('../../body/Body.js');
var jsxRuntime = require('react/jsx-runtime');
var typography = require('../../common/propsValues/typography.js');

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

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