import { createBrowserRouter } from "react-router";
import Layout from "./layout.jsx";
import HomePage from "./pages/Home/HomePage";
import LoginPage from "./pages/Login/LoginPage";
import RegisterPage from "./pages/Register/RegisterPage.jsx";
import VolunteersPage from "./pages/Volunteers/VolunteersPage.tsx";
import ProfilePage from "./pages/Profile/ProfilePage";
import EventsPage from "./pages/Events/EventsPage.jsx";
import AdminPage from "./pages/Admin/AdminPage.jsx";
import ValidationErrorPage from "./pages/waitValidationPage/ValidationErrorPage.jsx";
import PageNotFound from "./pages/PageNotFound/PageNotFound.jsx";
import eventDetail from "./pages/eventDetail/eventDetail.jsx";
import legalNotices from "./pages/LegalNotices/LegalNotices.jsx";
import RGPD from "./pages/RGPD/RGPD.jsx";

const router = createBrowserRouter([
    {
      path: "/login",
      Component: LoginPage,
    },
    {
        path: "/register",
        Component: RegisterPage,
    },
    {
        path: "/error/validation",
        Component: ValidationErrorPage
    },
    {
        path: "/*",
        Component: PageNotFound,
    },
    {
        path: "/404",
        Component: PageNotFound,
    },
    {
        path: "/",
        Component: Layout,
        children: [
            {
                path: "/",
                Component: HomePage,
            },
            {
                path: "/admin",
                Component:AdminPage,
            },
            {
                path: "/events",
                Component: EventsPage,
            },
            {
                path: "/volunteers",
                Component: VolunteersPage,
            },
            {
                path:"/profile",
                Component:ProfilePage,
            },
            {
                path: "/profile/:id",
                Component: ProfilePage,
            },
            {
                path: "/events/:id",
                Component: eventDetail,
            },
            {
                path: "/legalNotices",
                Component: legalNotices,
            },
            {
                path: "/rgpd",
                Component: RGPD,
            },
        ]
    }
])

export default router;