2025-05-17 20:17:39 +02:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import SettingsPage from "./SettingsPage";
|
|
|
|
|
import Loading from "@/components/Loading";
|
|
|
|
|
|
2025-05-20 00:52:17 +02:00
|
|
|
import { useEffect } from "react";
|
|
|
|
|
import useAuth from "@/hooks/useAuth";
|
2025-05-17 20:17:39 +02:00
|
|
|
|
|
|
|
|
export default function Dashboard() {
|
2025-05-20 00:52:17 +02:00
|
|
|
const { loading, username, name, email, validate } = useAuth();
|
2025-05-17 20:17:39 +02:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
2025-05-20 00:52:17 +02:00
|
|
|
const runValidation = async () => {
|
|
|
|
|
await validate();
|
|
|
|
|
};
|
|
|
|
|
runValidation();
|
|
|
|
|
}, [validate]);
|
2025-05-17 20:17:39 +02:00
|
|
|
|
|
|
|
|
if (loading) {
|
|
|
|
|
return <Loading />;
|
|
|
|
|
} else {
|
2025-05-17 21:08:08 +02:00
|
|
|
return <SettingsPage username={username} name={name} email={email} />;
|
2025-05-17 20:17:39 +02:00
|
|
|
}
|
|
|
|
|
}
|