62 lines
1.5 KiB
TypeScript
62 lines
1.5 KiB
TypeScript
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 LegalPage from "@/pages/LegalPage.tsx";
|
|
import ChatRouter from "@/pages/chat/ChatRouter.tsx";
|
|
import DebugPage from "@/pages/test/DebugPage.tsx";
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: "/",
|
|
element: <Layout/>,
|
|
children: [
|
|
{
|
|
index: true,
|
|
element: <HomePage/>
|
|
},
|
|
{
|
|
path: "legal/:page",
|
|
element: <LegalPage/>
|
|
},
|
|
{
|
|
path: "events/*",
|
|
element: <EventsRouter/>,
|
|
},
|
|
{
|
|
path: "chat/*",
|
|
element: <ChatRouter/>,
|
|
},
|
|
{
|
|
path: "debug",
|
|
element: <DebugPage/>
|
|
},
|
|
{
|
|
path: "util",
|
|
children: [
|
|
{
|
|
path: "qr",
|
|
element: <QRCodeGenerator/>
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: "*",
|
|
element: <NotFound/>
|
|
}
|
|
]
|
|
}
|
|
])
|
|
|
|
|
|
function Router() {
|
|
|
|
return (
|
|
<RouterProvider router={router}/>
|
|
)
|
|
}
|
|
|
|
export default Router
|