'use client' import React from 'react'; import { IoCloseCircleOutline } from "react-icons/io5"; import style from './LangSwitcher.module.scss' import { useRouter } from "next/navigation"; import { LangOption } from '@/meta/settings'; interface Props { handleClose(): void labels: { title: string langs: LangOption[] } } const LangSwitcher: React.FC = (props) => { const { labels, handleClose } = props const router = useRouter(); const setOption = (option: LangOption) => { router.push(`/${option.code}`); }; return (
{labels.title}
{ handleClose() }}>

{labels.langs.map((elem, key) => { e.preventDefault(); setOption(elem); handleClose(); }} key={key}>{elem.label} )}

); }; export default LangSwitcher;