stuve-it-frontend/src/Router.tsx

61 lines
1.5 KiB
TypeScript
Raw Normal View History

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-04-14 01:33:44 +00:00
import PrivacyPolicy from "./pages/privacy-policy.page.tsx";
import TermsAndConditions from "./pages/terms-and-conditions.page.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
{
path: "privacy-policy",
element: <PrivacyPolicy/>
},
{
path: "imprint",
element: <PrivacyPolicy/>
},
{
path: "terms-and-conditions",
element: <TermsAndConditions/>
},
{
path: "events/*",
2024-05-13 14:22:31 +00:00
element: <EventsRouter/>,
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