import { formatMoney } from '@transferwise/formatting';
import PropTypes from 'prop-types';
import React from 'react';
import { useIntl } from 'react-intl';
import { s as styleInject } from './style-inject.es-1f59c1d0.js';

const ConditionalWrapper = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;

var css_248z = ".cc_feeText_3768290182 {\n  display: flex;\n  font-weight: 600;\n  line-height: 16px;\n  white-space: nowrap;\n}\n@media (min-width: 768px) {\n  .cc_feeText_3768290182 {\n    line-height: var(--line-height-body);\n  }\n}\n.cc_feeDisclaimer_3768290182 {\n  color: #df8700;\n  font-size: small;\n  font-weight: 600;\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9jb21tb24vVHJhbnNmZXJGZWUubW9kdWxlLmxlc3MiLCJUcmFuc2ZlckZlZS5tb2R1bGUubGVzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQTtFQUNFLGFBQUE7RUFDQSxnQkFBQTtFQUNBLGlCQUFBO0VBQ0EsbUJBQUE7QUNGRjtBRElFO0VBQUE7SUFDRSxvQ0FBQTtFQ0RGO0FBQ0Y7QURJQTtFQUNFLGNBQUE7RUFDQSxnQkFBQTtFQUNBLGdCQUFBO0FDRkYiLCJmaWxlIjoiVHJhbnNmZXJGZWUubW9kdWxlLmxlc3MifQ== */";
var componentStyles = {"feeText":"cc_feeText_3768290182","feeDisclaimer":"cc_feeDisclaimer_3768290182"};
styleInject(css_248z);

/* eslint-disable react/jsx-filename-extension */
const TransferFee = ({
  styles,
  currency,
  fee,
  label
}) => {
  const {
    locale
  } = useIntl();
  const derivedStyles = {
    ...componentStyles,
    ...styles
  };
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
    className: derivedStyles.feeText,
    "data-testid": "transfer-fee"
  }, formatMoney(fee, currency, locale, {
    alwaysShowDecimals: true
  })), label);
};
TransferFee.propTypes = {
  styles: PropTypes.shape({
    feeText: PropTypes.string
  }),
  currency: PropTypes.string.isRequired,
  fee: PropTypes.number.isRequired,
  label: PropTypes.element
};
TransferFee.defaultProps = {
  styles: {},
  label: null
};

export { ConditionalWrapper as C, TransferFee as T };
//# sourceMappingURL=TransferFee-2b6337fd.js.map
