import { ReactNode } from "react"; import { Navigate, useLocation } from "react-router-dom"; import { useAuth } from "@/contexts/AuthContext"; export default function ProtectedRoute({ children }: { children: ReactNode }) { const { user, loading } = useAuth(); const location = useLocation(); if (loading) { return (
); } if (!user) return ; return <>{children}; }