import React from 'react'
import Navbar from "./components/Navbar.jsx"
import { BrowserRouter, Route, Routes } from "react-router-dom"
import LoginModule from "./modules/LoginModule.jsx"
import ProtectedRoute from "./components/ProtectedRoute.jsx"
import HomeModule from "./modules/HomeModule.jsx"
import AccountsModule from "./modules/AccountsModule.jsx"
import ProjectsModule from "./modules/ProjectsModule.jsx"
import VisitsModule from "./modules/VisitsModule.jsx"
import ReportsModule from "./modules/ReportsModule.jsx"
import UserModule from "./modules/UserModule.jsx"

function App() {
  return (
    <div className="d-flex flex-column">
      <BrowserRouter>
        <Routes>
          <Route path="/login" element={<LoginModule />} />
          <Route path="/" element={
            <ProtectedRoute>
              <Navbar />
              <HomeModule />
            </ProtectedRoute>
          } />
          <Route path="/accounts" element={
            <ProtectedRoute>
              <Navbar />
              <AccountsModule />
            </ProtectedRoute>
          } />
          <Route path="/projects" element={
            <ProtectedRoute>
              <Navbar />
              <ProjectsModule />
            </ProtectedRoute>
          } />
          <Route path="/visits" element={
            <ProtectedRoute>
              <Navbar />
              <VisitsModule />
            </ProtectedRoute>
          } />
          <Route path="/reports" element={
            <ProtectedRoute>
              <Navbar />
              <ReportsModule />
            </ProtectedRoute>
          } />
          <Route path="/user" element={
            <ProtectedRoute>
              <Navbar />
              <UserModule />
            </ProtectedRoute>
          } />
        </Routes>
      </BrowserRouter>
    </div>
  )
}

export default App
