@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
29 lines • 1.12 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
const _excluded = ["value", "className", "label"];
import React from 'react';
import classnames from 'classnames';
import { useTranslation, useValueProps } from '../../hooks';
import ValueBlock from '../../ValueBlock';
import useCurrency from './useCurrency';
function SelectCurrency(props) {
const translations = useTranslation().SelectCurrency;
const _useValueProps = useValueProps(props),
{
value,
className,
label = translations.label
} = _useValueProps,
rest = _objectWithoutProperties(_useValueProps, _excluded);
const {
getCurrencyDisplayNameByIso
} = useCurrency();
return React.createElement(ValueBlock, _extends({
label: label,
className: classnames('dnb-forms-value-select-currency', className)
}, rest), getCurrencyDisplayNameByIso(value));
}
SelectCurrency.useCurrency = useCurrency;
SelectCurrency._supportsSpacingProps = true;
export default SelectCurrency;
//# sourceMappingURL=SelectCurrency.js.map