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

48 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-11-24 13:05:10 +00:00
import type { ModuleClientParams } from "@erp/core/client";
2025-08-11 17:49:52 +00:00
import { lazy } from "react";
2025-11-24 13:05:10 +00:00
import { Outlet, type RouteObject } from "react-router-dom";
2025-08-11 17:49:52 +00:00
// Lazy load components
const CustomersLayout = lazy(() =>
import("./components").then((m) => ({ default: m.CustomersLayout }))
);
2025-10-20 09:35:24 +00:00
const CustomersList = lazy(() => import("./pages").then((m) => ({ default: m.CustomersListPage })));
2025-10-02 16:30:46 +00:00
const CustomerView = lazy(() => import("./pages").then((m) => ({ default: m.CustomerViewPage })));
const CustomerAdd = lazy(() => import("./pages").then((m) => ({ default: m.CustomerCreatePage })));
2025-11-04 16:02:42 +00:00
const CustomerUpdate = lazy(() =>
import("./pages").then((m) => ({ default: m.CustomerUpdatePage }))
);
2025-08-11 17:49:52 +00:00
export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "customers",
element: (
<CustomersLayout>
<Outlet context={params} />
</CustomersLayout>
),
children: [
2025-10-20 09:35:24 +00:00
{ path: "", index: true, element: <CustomersList /> }, // index
2025-08-11 17:49:52 +00:00
{ path: "list", element: <CustomersList /> },
2025-11-24 13:05:10 +00:00
//{ path: "create", element: <CustomerAdd /> },
2025-10-02 16:30:46 +00:00
{ path: ":id", element: <CustomerView /> },
2025-11-24 13:05:10 +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 /> },*/
],
},
];
};