import React from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import CourseForm from "./Pages/CourseForm";
import './App.css';
import AuthPage from "./Pages/Login";
import Accounts from "./Pages/Accounts";
import ForgetPwPage from "./Pages/ForgetPw";
import ResetPwPage from "./Pages/ResetPw";
import FilterPage from "./Pages/FilterPage";
import WelcomeWithFilter from "./Pages/WelcomeWithFilter";
import "react-toastify/dist/ReactToastify.css";
import CourseTable from "./Pages/CourseTable";
import ConsolidatedTable from "./Pages/ConsolidatedTable";
import CourseConsolidated from "./Pages/courseConsolidated";
import PrivateRoute from "./components/PrivateRoute";
import TokenRefresher from "./components/TokenRefresher";
import DepartmentConsolidated from "./Pages/DepartmentConsolidated";
import PanelConsolidated from "./Pages/PanelConsolidated";
import { AdminFacultyPage } from "./Pages/AdminFacultyPage";
import AdminCoursePage from "./Pages/AdminCoursePage";
import { ToastContainer } from "react-toastify";


function App() {
  return (
    <>
    <TokenRefresher />
    <ToastContainer/>
      <Routes>
        <Route path="/" element={<AuthPage />}></Route>
        <Route path="/course-form/:id" element={<PrivateRoute element={<CourseForm />} />} />
        <Route path="/Welcome" element={<PrivateRoute element={<WelcomeWithFilter />} />} />
        <Route path="/accounts" element={<Accounts />}></Route>
        <Route path="/ForgetPw" element={<ForgetPwPage />}></Route>
        <Route path="/ResetPw/:token" element={<ResetPwPage />}></Route>
        <Route path="/Filter" element={<PrivateRoute element={<FilterPage />} />}  />
        <Route path="/courses" element={<PrivateRoute element={<CourseTable />} />}  />
        <Route path="/consolidated" element={<PrivateRoute element={<ConsolidatedTable />} />}  />
        <Route path="/courseConsolidated" element={<PrivateRoute element={<CourseConsolidated />} />}  />
        <Route path="/departmentConsolidated" element={<PrivateRoute element={<DepartmentConsolidated />} />}  />
        <Route path="/panelConsolidated" element={<PrivateRoute element={<PanelConsolidated/>} />}  />
        <Route path="/AdminFacultyPage" element={<PrivateRoute element={<AdminFacultyPage/>} />}  />
        <Route path="/AdminCoursePage" element={<PrivateRoute element={<AdminCoursePage/>} />}  />
      </Routes>
      </>
  );
}

export default App;
