"use client"; import { useTranslation } from "react-i18next"; import { DarkModeToggle } from "@/app/user/components/DarkModeToggle"; import { LanguageDropDown } from "@/app/user/components/LanguageDropDown"; import Spinner from "@/lib/components/ui/Spinner"; import { useSupabase } from "@/lib/context/SupabaseProvider"; import { useUserData } from "@/lib/hooks/useUserData"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; import { UserStatistics } from "./components/UserStatistics"; const UserPage = (): JSX.Element => { const { session } = useSupabase(); const { t } = useTranslation(["translation", "user"]); const { userData: userStats } = useUserData(); if (session === null) { redirectToLogin(); } return (
{userStats ? ( <> ) : (
{t("fetching", { ns: "user" })}
)}
); }; export default UserPage;