import { Icon, Menu } from 'antd'; import { formatMessage, getLocale, setLocale } from 'umi-plugin-react/locale'; import { ClickParam } from 'antd/es/menu'; import React from 'react'; import classNames from 'classnames'; import DefaultSettings, { localeProps } from 'config/defaultSettings'; import HeaderDropdown from '../HeaderDropdown'; import styles from './index.less'; interface SelectLangProps { className?: string; locales: localeProps[]; } const SelectLang: React.FC = props => { const { className, locales } = props; const selectedLang = getLocale(); const changeLang = ({ key }: ClickParam): void => setLocale(key, false); const langMenu = ( {locales.map(({ key, icon, label }) => ( {icon} {' '} {label} ))} ); return locales.length >= 1 ? ( ) : null; }; export default SelectLang;