api ulandi

This commit is contained in:
Samandar Turgunboyev
2025-10-25 18:42:01 +05:00
parent 1a08775451
commit 05b752daf2
84 changed files with 11179 additions and 3724 deletions

View File

@@ -1,3 +1,4 @@
import httpClient from "@/shared/config/api/httpClient";
import { LanguageRoutes } from "@/shared/config/i18n/type";
import { Button } from "@/shared/ui/button";
import {
@@ -7,12 +8,16 @@ import {
DropdownMenuTrigger,
} from "@/shared/ui/dropdown-menu";
import { languages } from "@/widgets/lang-toggle/lib/data";
import { useQueryClient } from "@tanstack/react-query";
import { GlobeIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
const LangToggle = () => {
const { i18n } = useTranslation();
const queryClient = useQueryClient();
const changeLanguage = (lng: LanguageRoutes) => {
httpClient.defaults.headers.common["Accept-Language"] = lng;
queryClient.refetchQueries();
i18n.changeLanguage(lng);
};