import {Routes, Route, Navigate} from "react-router-dom";
import PrivateRoute from "./PrivateRoute.jsx";
import LoginPage from "../Components/Pages/LoginPage/LoginPage.jsx";
import MainLayout from "../Components/Layouts/MainLayout.jsx";
import PatientsPage from "../Components/Pages/PatientsPage/PatientsPage.jsx";
import HomePage from "../Components/Pages/HomePage.jsx";
import LensesSetsPage from "../Components/Pages/LensesSetsPage/LensesSetsPage.jsx";
import IssuesPage from "../Components/Pages/IssuesPage/IssuesPage.jsx";
import AppointmentsPage from "../Components/Pages/AppointmentsPage/AppointmentsPage.jsx";


const AppRouter = () => (
    <Routes>
        <Route path="/login" element={<LoginPage/>}/>

        <Route element={<PrivateRoute/>}>
            <Route element={<MainLayout/>}>
                <Route path={"/Patients"} element={<PatientsPage/>}/>
                <Route path={"/Lenses"} element={<LensesSetsPage/>}/>
                <Route path={"/issues"} element={<IssuesPage/>}/>
                <Route path={"/Appointments"} element={<AppointmentsPage/>}/>
                <Route path={"/"} element={<HomePage/>}/>
            </Route>
        </Route>
        <Route path={"*"} element={<Navigate to={"/"}/>}/>
    </Routes>
);

export default AppRouter;