completionId: cgen-09daffde5f524ffd87bc71303ec04f5a

cgen-09daffde5f524ffd87bc71303ec04f5a
This commit is contained in:
Builder.io 2025-11-11 21:51:30 +00:00
parent a51bf07e17
commit 7f92392a1f

View file

@ -18,14 +18,24 @@ import {
} from "lucide-react";
import { useNavigate } from "react-router-dom";
import { useEffect, useState, useRef } from "react";
import { useAuth } from "@/contexts/AuthContext";
import LoadingScreen from "@/components/LoadingScreen";
import { aethexToast } from "@/lib/aethex-toast";
export default function Staff() {
const navigate = useNavigate();
const { user, loading } = useAuth();
const [isLoading, setIsLoading] = useState(true);
const toastShownRef = useRef(false);
// Redirect unauthenticated users to login
useEffect(() => {
if (!loading && !user) {
navigate("/staff/login", { replace: true });
return;
}
}, [user, loading, navigate]);
useEffect(() => {
const timer = setTimeout(() => {
setIsLoading(false);