import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import "bootstrap/dist/css/bootstrap.min.css";
import Index from './index.tsx'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import Navbar from './Components/Navbar/Navbar.tsx'
import Search from './Pages/Search/Search.tsx';
import Login from './Pages/Login/Login.tsx';
import Admin from './Pages/Admin/Admin.tsx';
import NotFound from './Pages/NotFound/NotFound.tsx';
import ManageUser from './Pages/ManageUser/ManageUser.tsx';
import ServerManagement from './Pages/Admin/ServerManagement/ServerManagement.tsx';
import UserManagement from './Pages/Admin/UserManagement/UserManagement.tsx';

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <BrowserRouter>
      <Navbar />
      <Routes>
        <Route index={true} path="/" element={<Index />} />
        <Route path="/search" element={<Search />} />
        <Route path="/login" element={<Login />} />
        <Route path="/admin" element={<Admin />}>
          <Route path="users" element={<UserManagement />} />
          <Route path="servers" element={<ServerManagement />} />
        </Route>
        <Route path="/user" element={<ManageUser />} />
        <Route path="*" element={<NotFound />} />
      </Routes>
    </BrowserRouter>
  </StrictMode>,
)
