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/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";
import ProfilePage from "../Components/Pages/ProfilePage/ProfilePage.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={"/profile"} element={<ProfilePage/>}/>
                <Route path={"/"} element={<HomePage/>}/>
            </Route>
        </Route>
        <Route path={"*"} element={<Navigate to={"/"}/>}/>
    </Routes>
);

export default AppRouter;