import React from "react"; import ReactDOM from "react-dom/client"; import "./index.css"; import { createBrowserRouter, RouterProvider } from "react-router-dom"; import App from "./Pages/App"; import YourProjectsPage from "./Pages/YourProjectsPage.tsx"; import UserProjectPage from "./Pages/UserPages/UserProjectPage.tsx"; import AdminMenuPage from "./Pages/AdminPages/AdminMenuPage.tsx"; import UserEditTimeReportPage from "./Pages/UserPages/UserEditTimeReportPage.tsx"; import UserNewTimeReportPage from "./Pages/UserPages/UserNewTimeReportPage.tsx"; import UserViewTimeReportsPage from "./Pages/UserPages/UserViewTimeReportsPage.tsx"; import PMChangeRole from "./Pages/ProjectManagerPages/PMChangeRole.tsx"; import PMOtherUsersTR from "./Pages/ProjectManagerPages/PMOtherUsersTR.tsx"; import PMProjectMembers from "./Pages/ProjectManagerPages/PMProjectMembers.tsx"; import PMProjectPage from "./Pages/ProjectManagerPages/PMProjectPage.tsx"; import PMTotalTimeActivity from "./Pages/ProjectManagerPages/PMTotalTimeActivity.tsx"; import PMTotalTimeRole from "./Pages/ProjectManagerPages/PMTotalTimeRole.tsx"; import PMUnsignedReports from "./Pages/ProjectManagerPages/PMUnsignedReports.tsx"; import PMViewUnsignedReport from "./Pages/ProjectManagerPages/PMViewUnsignedReport.tsx"; import AdminManageUsers from "./Pages/AdminPages/AdminManageUsers.tsx"; import AdminViewUserInfo from "./Pages/AdminPages/AdminViewUserInfo.tsx"; import AdminManageProjects from "./Pages/AdminPages/AdminManageProjects.tsx"; import AdminAddProject from "./Pages/AdminPages/AdminAddProject.tsx"; import AdminAddUser from "./Pages/AdminPages/AdminAddUser.tsx"; import AdminChangeUsername from "./Pages/AdminPages/AdminChangeUsername.tsx"; import AdminProjectAddMember from "./Pages/AdminPages/AdminProjectAddMember.tsx"; import AdminProjectChangeUserRole from "./Pages/AdminPages/AdminProjectChangeUserRole.tsx"; import AdminProjectManageMembers from "./Pages/AdminPages/AdminProjectManageMembers.tsx"; import AdminProjectStatistics from "./Pages/AdminPages/AdminProjectStatistics.tsx"; import AdminProjectViewMemberInfo from "./Pages/AdminPages/AdminProjectViewMemberInfo.tsx"; import AdminProjectPage from "./Pages/AdminPages/AdminProjectPage.tsx"; import NotFoundPage from "./Pages/NotFoundPage.tsx"; // This is where the routes are mounted const router = createBrowserRouter([ { path: "/", element: , errorElement: , }, { path: "/admin", element: , }, { path: "/yourProjects", element: , }, { path: "/project/:projectName", element: , }, { path: "/newTimeReport/:projectName", element: , }, { path: "/timeReports/:projectName", element: , }, { path: "/editTimeReport/:projectName/:weekNumber", element: , }, { path: "/changeRole", element: , }, { path: "/otherUsersTimeReports", element: , }, { path: "/projectMembers", element: , }, { path: "/PMProjectPage", element: , }, { path: "/PMTimeActivity", element: , }, { path: "/PMTimeRole", element: , }, { path: "/PMUnsignedReports", element: , }, { path: "/PMViewUnsignedReport", element: , }, { path: "/adminChangeUsername", element: , }, { path: "/adminProjectAddMember", element: , }, { path: "/adminProjectChangeUserRole", element: , }, { path: "/adminProjectManageMembers", element: , }, { path: "/adminProjectPage", element: , }, { path: "/adminProjectStatistics", element: , }, { path: "/adminProjectViewMembers", element: , }, { path: "/addProject", element: , }, { path: "/adminAddUser", element: , }, { path: "/adminUserInfo", element: , }, { path: "/adminManageProject", element: , }, { path: "/adminManageUser", element: , }, ]); // Semi-hacky way to get the root element const root = document.getElementById("root") ?? document.createElement("div"); // Render the router at the root ReactDOM.createRoot(root).render( , );