2024-03-26 16:07:08 +00:00
|
|
|
import {createBrowserRouter, RouterProvider} from "react-router-dom";
|
2024-04-14 01:33:44 +00:00
|
|
|
import HomePage from "./pages/home/index.page.tsx";
|
|
|
|
import NotFound from "./pages/not-found/index.page.tsx";
|
2024-05-13 14:22:31 +00:00
|
|
|
import Layout from "@/components/layout";
|
2024-04-14 01:33:44 +00:00
|
|
|
import QRCodeGenerator from "./pages/util/qr/index.page.tsx";
|
2024-05-13 14:22:31 +00:00
|
|
|
import EventsRouter from "./pages/events/EventsRouter.tsx";
|
2024-05-13 16:41:56 +00:00
|
|
|
import LegalPage from "@/pages/LegalPage.tsx";
|
2024-05-22 15:09:00 +00:00
|
|
|
import ChatRouter from "@/pages/chat/ChatRouter.tsx";
|
|
|
|
import DebugPage from "@/pages/test/DebugPage.tsx";
|
2024-03-26 16:07:08 +00:00
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
element: <Layout/>,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
index: true,
|
|
|
|
element: <HomePage/>
|
|
|
|
},
|
2024-04-14 01:33:44 +00:00
|
|
|
{
|
2024-05-13 16:41:56 +00:00
|
|
|
path: "legal/:page",
|
|
|
|
element: <LegalPage/>
|
2024-04-14 01:33:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "events/*",
|
2024-05-13 14:22:31 +00:00
|
|
|
element: <EventsRouter/>,
|
2024-04-14 01:33:44 +00:00
|
|
|
},
|
2024-05-22 15:09:00 +00:00
|
|
|
{
|
|
|
|
path: "chat/*",
|
|
|
|
element: <ChatRouter/>,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "debug",
|
|
|
|
element: <DebugPage/>
|
|
|
|
},
|
2024-04-14 01:33:44 +00:00
|
|
|
{
|
|
|
|
path: "util",
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "qr",
|
|
|
|
element: <QRCodeGenerator/>
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2024-03-26 16:07:08 +00:00
|
|
|
{
|
|
|
|
path: "*",
|
|
|
|
element: <NotFound/>
|
|
|
|
}
|
|
|
|
]
|
2024-05-13 14:22:31 +00:00
|
|
|
}
|
2024-03-26 16:07:08 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
function Router() {
|
|
|
|
|
|
|
|
return (
|
|
|
|
<RouterProvider router={router}/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Router
|