resistants/src/router.tsx

25 lines
570 B
TypeScript
Raw Normal View History

2023-02-20 17:22:01 +00:00
import React from "react";
2023-02-23 22:03:06 +00:00
import { createHashRouter } from "react-router-dom";
import { Layout } from "./Layout";
2023-02-20 17:22:01 +00:00
import NotFound from "./routes/NotFound";
2023-02-23 22:03:06 +00:00
import { ListeResistants } from "./routes/Liste";
import { PageResistant } from "./routes/PageResistant";
2023-02-20 17:22:01 +00:00
2023-02-23 22:03:06 +00:00
export const router = createHashRouter([
{
2023-02-20 17:22:01 +00:00
path: "/",
2023-02-23 22:03:06 +00:00
element: <Layout />,
errorElement: <NotFound />,
2023-02-20 17:22:01 +00:00
children: [
2023-02-23 22:03:06 +00:00
{
path: "/",
element: <ListeResistants />,
},
{
path: ":idResistant",
2023-02-23 22:03:06 +00:00
element: <PageResistant />,
},
],
},
]);