import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import { ButtonGroup, Dropdown, DropdownButton, } from 'react-bootstrap'; import { FormattedMessage } from './localization'; import { availableLocales, defaultLocale, localeDescriptions } from '../util/localization'; export default function LocaleSwitcher({ locale = defaultLocale, onChangeLocale = null, disabled = false, showLoading = false, }: { locale?: string, onChangeLocale?: (value: string) => void, disabled?: boolean, showLoading?: boolean, } = {}) { return ( )} > { availableLocales.map((thisLocale) => ( { onChangeLocale(thisLocale); } : null } active={locale === thisLocale} data-lang={thisLocale} > )) } ); }