UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

27 lines 1.01 kB
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 useCountry from "./useCountry.js"; function SelectCountry(props) { var _getCountryNameByIso; const translations = useTranslation().SelectCountry; const { value, className, label = translations.label, ...rest } = useValueProps(props); const { getCountryNameByIso } = useCountry(); return React.createElement(ValueBlock, _extends({ label: label, className: classnames('dnb-forms-value-select-country', className) }, rest), (_getCountryNameByIso = getCountryNameByIso(value)) !== null && _getCountryNameByIso !== void 0 ? _getCountryNameByIso : value); } SelectCountry.useCountry = useCountry; SelectCountry._supportsSpacingProps = true; export default SelectCountry; //# sourceMappingURL=SelectCountry.js.map