UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

32 lines 1.12 kB
import React from 'react'; import clsx from 'clsx'; import { useTranslation, useValueProps } from "../../hooks/index.js"; import ValueBlock from "../../ValueBlock/index.js"; import useCurrency from "./useCurrency.js"; import withComponentMarkers from "../../../../shared/helpers/withComponentMarkers.js"; import { jsx as _jsx } from "react/jsx-runtime"; function SelectCurrency(props) { var _getCurrencyDisplayNa; const translations = useTranslation().SelectCurrency; const { value, className, label = translations.label, ...rest } = useValueProps(props); const { getCurrencyDisplayNameByIso } = useCurrency(); return _jsx(ValueBlock, { label: label, className: clsx('dnb-forms-value-select-currency', className), ...rest, children: (_getCurrencyDisplayNa = getCurrencyDisplayNameByIso(value)) !== null && _getCurrencyDisplayNa !== void 0 ? _getCurrencyDisplayNa : value }); } SelectCurrency.useCurrency = useCurrency; withComponentMarkers(SelectCurrency, { _supportsSpacingProps: true }); export default SelectCurrency; //# sourceMappingURL=SelectCurrency.js.map