"use client"; import { useSetAtom } from "jotai"; import { useSession } from "next-auth/react"; import { useTranslations } from "next-intl"; import { useParams } from "next/navigation"; import { FaGithub, FaRegEnvelope } from "react-icons/fa"; import { MdOutlinePrivacyTip } from "react-icons/md"; import { burgerMenuIsOpenAtom } from "@/atoms"; import { setUserLocale } from "@/server/setUserLocale"; import { Link, usePathname, useRouter } from "@/utils/routing"; import ThemeSwitcher from "./ThemeSwitcher"; export default function Footer() { const t = useTranslations("Footer"); const setBurgerMenuIsOpen = useSetAtom(burgerMenuIsOpenAtom); const router = useRouter(); const pathname = usePathname(); const params = useParams(); const { status } = useSession(); const changeLanguage = async (lang: string) => { // Store the user's locale preference if they're authenticated if (status === "authenticated") await setUserLocale(lang); // Redirect to the same page with the new locale router.push({ pathname, params: params as any }, { locale: lang }); }; return ( ); }