import {createBrowserRouter, RouterProvider} from "react-router-dom";
import HomePage from "./pages/home/index.page.tsx";
import NotFound from "./pages/not-found/index.page.tsx";
import Layout from "@/components/layout";
import QRCodeGenerator from "./pages/util/qr/index.page.tsx";
import EventsRouter from "./pages/events/EventsRouter.tsx";
import PrivacyPolicy from "./pages/privacy-policy.page.tsx";
import TermsAndConditions from "./pages/terms-and-conditions.page.tsx";

const router = createBrowserRouter([
    {
        path: "/",
        element: <Layout/>,
        children: [
            {
                index: true,
                element: <HomePage/>
            },
            {
                path: "privacy-policy",
                element: <PrivacyPolicy/>
            },
            {
                path: "imprint",
                element: <PrivacyPolicy/>
            },
            {
                path: "terms-and-conditions",
                element: <TermsAndConditions/>
            },
            {
                path: "events/*",
                element: <EventsRouter/>,
            },
            {
                path: "util",
                children: [
                    {
                        path: "qr",
                        element: <QRCodeGenerator/>
                    }
                ]
            },
            {
                path: "*",
                element: <NotFound/>
            }
        ]
    }
])


function Router() {

    return (
        <RouterProvider router={router}/>
    )
}

export default Router
