@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
29 lines • 1.09 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 useCountry from './useCountry';
function SelectCountry(props) {
const translations = useTranslation().SelectCountry;
const _useValueProps = useValueProps(props),
{
value,
className,
label = translations.label
} = _useValueProps,
rest = _objectWithoutProperties(_useValueProps, _excluded);
const {
getCountryNameByIso
} = useCountry();
return React.createElement(ValueBlock, _extends({
label: label,
className: classnames('dnb-forms-value-select-country', className)
}, rest), getCountryNameByIso(value));
}
SelectCountry.useCountry = useCountry;
SelectCountry._supportsSpacingProps = true;
export default SelectCountry;
//# sourceMappingURL=SelectCountry.js.map