2023-10-05 18:50:02 +03:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
|
2024-02-04 04:45:05 +03:00
|
|
|
import { CountrySelector } from "@/lib/components/ui/CountrySelector/CountrySelector";
|
|
|
|
|
2023-10-05 18:50:02 +03:00
|
|
|
import { useLanguageHook } from "./hooks/useLanguageHook";
|
|
|
|
|
|
|
|
const LanguageSelect = (): JSX.Element => {
|
|
|
|
const { t } = useTranslation(["translation"]);
|
2024-02-04 04:45:05 +03:00
|
|
|
const { currentLanguage, change } = useLanguageHook();
|
|
|
|
|
|
|
|
if (!currentLanguage) {
|
|
|
|
return <></>;
|
|
|
|
}
|
2023-10-05 18:50:02 +03:00
|
|
|
|
|
|
|
return (
|
2024-02-04 04:45:05 +03:00
|
|
|
<CountrySelector
|
|
|
|
iconName="flag"
|
|
|
|
label={t("languageSelect")}
|
|
|
|
currentValue={currentLanguage}
|
|
|
|
setCurrentValue={change}
|
|
|
|
/>
|
2023-10-05 18:50:02 +03:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
LanguageSelect.displayName = "LanguageSelect";
|
|
|
|
|
|
|
|
export default LanguageSelect;
|