32 lines
618 B
TypeScript
32 lines
618 B
TypeScript
|
import {createBrowserRouter, RouterProvider} from "react-router-dom";
|
||
|
import HomePage from "./pages/home";
|
||
|
import NotFound from "./pages/not-found";
|
||
|
import Layout from "./components/layout";
|
||
|
|
||
|
const router = createBrowserRouter([
|
||
|
{
|
||
|
path: "/",
|
||
|
element: <Layout/>,
|
||
|
children: [
|
||
|
{
|
||
|
index: true,
|
||
|
element: <HomePage/>
|
||
|
},
|
||
|
{
|
||
|
path: "*",
|
||
|
element: <NotFound/>
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
])
|
||
|
|
||
|
|
||
|
function Router() {
|
||
|
|
||
|
return (
|
||
|
<RouterProvider router={router}/>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
export default Router
|