43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import {
|
|
createBrowserRouter,
|
|
} from "react-router";
|
|
|
|
import Root from "@/root";
|
|
import { Home } from "@/pages/Home";
|
|
import { Forms } from "@/pages/Forms";
|
|
import Dashboard from "@/pages/Dashboard";
|
|
import Productors from "@/pages/Productors";
|
|
import Products from "@/pages/Products";
|
|
import Templates from "@/pages/Templates";
|
|
import Users from "@/pages/Users";
|
|
// import { CreateForms } from "@/pages/Forms/CreateForm";
|
|
|
|
export const router = createBrowserRouter([
|
|
{
|
|
path: "/",
|
|
Component: Root,
|
|
// errorElement: <NotFound />,
|
|
children: [
|
|
{ index: true, Component: Home },
|
|
{ path: "/forms", Component: Forms },
|
|
{ path: "/dashboard", Component: Dashboard, children: [
|
|
{path: "productors", Component: Productors},
|
|
{path: "productors/create", Component: Productors},
|
|
{path: "productors/:id/edit", Component: Productors},
|
|
{ path: "products", Component: Products },
|
|
{path: "products/create", Component: Products},
|
|
{path: "products/:id/edit", Component: Products},
|
|
{ path: "templates", Component: Templates },
|
|
{ path: "users", Component: Users },
|
|
{path: "users/create", Component: Users},
|
|
{path: "users/:id/edit", Component: Users},
|
|
{ path: "forms", Component: Forms },
|
|
{ path: "forms/:id/edit", Component: Forms },
|
|
{ path: "forms/create", Component: Forms },
|
|
] },
|
|
|
|
// { path: "/form/:id", Component: ReadForm },
|
|
],
|
|
},
|
|
]);
|