import React, { useEffect, useState } from 'react'; import Select, { components, SingleValueProps, OptionProps } from 'react-select'; type LanguageOption = { label: string; value: string }; const LANGS: LanguageOption[] = [ { value: 'en', label: '🇬🇧 EN' }, { value: 'fr', label: '🇫🇷 FR' }, { value: 'es', label: '🇪🇸 ES' }, { value: 'de', label: '🇩🇪 DE' }, ]; const Option = (props: OptionProps) => ( {props.data.label} ); const SingleVal = (props: SingleValueProps) => ( {props.data.label} ); const LanguageSwitcher: React.FC = () => { const [mounted, setMounted] = useState(false); const [selected, setSelected] = useState(LANGS[0]); useEffect(() => { setMounted(true); }, []); const handleChange = (opt: LanguageOption | null) => { if (!opt) return; setSelected(opt); }; if (!mounted) return null; return (