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-03-26 16:07:08 +00:00
import Layout from "./components/layout";
2024-04-14 01:33:44 +00:00
import QRCodeGenerator from "./pages/util/qr/index.page.tsx";
import EventRouter from "./pages/events/router.tsx";
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/*",
element: <EventRouter/>,
},
{
path: "util",
children: [
{
path: "qr",
element: <QRCodeGenerator/>
}
]
},
2024-03-26 16:07:08 +00:00
{
path: "*",
element: <NotFound/>
}
]
},
])
function Router() {
return (
<RouterProvider router={router}/>
)
}
export default Router