@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
32 lines • 1.08 kB
JavaScript
import React from 'react';
import clsx from 'clsx';
import { useTranslation, useValueProps } from "../../hooks/index.js";
import ValueBlock from "../../ValueBlock/index.js";
import useCountry from "./useCountry.js";
import withComponentMarkers from "../../../../shared/helpers/withComponentMarkers.js";
import { jsx as _jsx } from "react/jsx-runtime";
function SelectCountry(props) {
var _getCountryNameByIso;
const translations = useTranslation().SelectCountry;
const {
value,
className,
label = translations.label,
...rest
} = useValueProps(props);
const {
getCountryNameByIso
} = useCountry();
return _jsx(ValueBlock, {
label: label,
className: clsx('dnb-forms-value-select-country', className),
...rest,
children: (_getCountryNameByIso = getCountryNameByIso(value)) !== null && _getCountryNameByIso !== void 0 ? _getCountryNameByIso : value
});
}
SelectCountry.useCountry = useCountry;
withComponentMarkers(SelectCountry, {
_supportsSpacingProps: true
});
export default SelectCountry;
//# sourceMappingURL=SelectCountry.js.map