import cn from 'clsx'; import Link from 'next/link'; import { FC, useState } from 'react'; import { useRouter } from 'next/router'; import s from './I18nWidget.module.css'; import { Cross, ChevronUp } from '@components/icons'; import ClickOutside from '@lib/click-outside'; interface LOCALE_DATA { name: string; img: { filename: string; alt: string; }; } const LOCALES_MAP: Record = { es: { name: 'EspaƱol', img: { filename: 'flag-es-co.svg', alt: 'Bandera Colombiana', }, }, 'en-US': { name: 'English', img: { filename: 'flag-en-us.svg', alt: 'US Flag', }, }, }; const I18nWidget: FC = () => { const [display, setDisplay] = useState(false); const { locale, locales, defaultLocale = 'en-US', asPath: currentPath, } = useRouter(); const options = locales?.filter((val) => val !== locale); const currentLocale = locale || defaultLocale; return ( setDisplay(false)}> ); }; export default I18nWidget;