mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-19 08:26:07 +00:00
25 lines
523 B
TypeScript
25 lines
523 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import ServersPage from "./ServersPage";
|
||
|
|
import Loading from "@/components/Loading";
|
||
|
|
|
||
|
|
import { useEffect } from "react";
|
||
|
|
import useAuth from "@/hooks/useAuth";
|
||
|
|
|
||
|
|
export default function Dashboard() {
|
||
|
|
const { loading, username, name, validate } = useAuth();
|
||
|
|
|
||
|
|
useEffect(() => {
|
||
|
|
const runValidation = async () => {
|
||
|
|
await validate();
|
||
|
|
};
|
||
|
|
|
||
|
|
runValidation();
|
||
|
|
}, [validate]);
|
||
|
|
|
||
|
|
if (loading) {
|
||
|
|
return <Loading />;
|
||
|
|
} else {
|
||
|
|
return <ServersPage username={username} name={name} />;
|
||
|
|
}
|
||
|
|
}
|