import React from 'react'; import { Navigate, Outlet } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; const PrivateRoute = () => { const { currentUser } = useAuth(); if (currentUser === undefined) { return
Loading...
; // Or a spinner/loading component } return currentUser ? : ; }; export default PrivateRoute;