import { BrowserRouter, Routes, Route, useLocation } from 'react-router-dom' import { LoginForm } from '@/components/auth/login-form' import { Navbar } from '@/components/layout/navbar' import { HomePage } from '@/pages/home' import { Projects } from '@/pages/projects' import { ProjectTasks } from '@/pages/project-tasks' import { Users } from '@/pages/users' import { AuthProvider, useAuth } from '@/contexts/auth-context' function AppContent() { const location = useLocation() const { isAuthenticated, isLoading, logout } = useAuth() const showNavbar = location.pathname !== '/' || isAuthenticated const handleLogin = () => { // The actual login logic is handled by the LoginForm component // which will call the login method from useAuth() } // Show loading while checking auth status if (isLoading) { return (

Checking authentication...

) } if (!isAuthenticated) { return } return (
{showNavbar && }
} /> } /> } /> } /> } />
) } function App() { return ( ) } export default App