@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
27 lines • 1.04 kB
JavaScript
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
import React from 'react';
import classnames from 'classnames';
import { useTranslation, useValueProps } from "../../hooks/index.js";
import ValueBlock from "../../ValueBlock/index.js";
import useCurrency from "./useCurrency.js";
function SelectCurrency(props) {
var _getCurrencyDisplayNa;
const translations = useTranslation().SelectCurrency;
const {
value,
className,
label = translations.label,
...rest
} = useValueProps(props);
const {
getCurrencyDisplayNameByIso
} = useCurrency();
return React.createElement(ValueBlock, _extends({
label: label,
className: classnames('dnb-forms-value-select-currency', className)
}, rest), (_getCurrencyDisplayNa = getCurrencyDisplayNameByIso(value)) !== null && _getCurrencyDisplayNa !== void 0 ? _getCurrencyDisplayNa : value);
}
SelectCurrency.useCurrency = useCurrency;
SelectCurrency._supportsSpacingProps = true;
export default SelectCurrency;
//# sourceMappingURL=SelectCurrency.js.map