Uecko_ERP/modules/customers/src/web/customer-routes.tsx

45 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-08-11 17:49:52 +00:00
import { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, RouteObject } from "react-router-dom";
2025-09-16 17:29:37 +00:00
import { CustomerUpdate } from "./pages/update";
2025-08-11 17:49:52 +00:00
// Lazy load components
const CustomersLayout = lazy(() =>
import("./components").then((m) => ({ default: m.CustomersLayout }))
);
const CustomersList = lazy(() => import("./pages").then((m) => ({ default: m.CustomersList })));
const CustomerAdd = lazy(() => import("./pages").then((m) => ({ default: m.CustomerCreate })));
export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "customers",
element: (
<CustomersLayout>
<Outlet context={params} />
</CustomersLayout>
),
children: [
{ path: "", index: true, element: <CustomersList /> }, // index
{ path: "list", element: <CustomersList /> },
{ path: "create", element: <CustomerAdd /> },
2025-09-16 17:29:37 +00:00
{ path: ":id/edit", element: <CustomerUpdate /> },
2025-08-11 17:49:52 +00:00
//
/*{ path: "create", element: <CustomersList /> },
{ path: ":id", element: <CustomersList /> },
{ path: ":id/edit", element: <CustomersList /> },
{ path: ":id/delete", element: <CustomersList /> },
{ path: ":id/view", element: <CustomersList /> },
{ path: ":id/print", element: <CustomersList /> },
{ path: ":id/email", element: <CustomersList /> },
{ path: ":id/download", element: <CustomersList /> },
{ path: ":id/duplicate", element: <CustomersList /> },
{ path: ":id/preview", element: <CustomersList /> },*/
],
},
];
};