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

46 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
2026-03-07 18:27:23 +00:00
const CustomerLayout = lazy(() => import("./ui").then((m) => ({ default: m.CustomerLayout })));
const CustomersList = lazy(() => import("./list").then((m) => ({ default: m.CustomerListPage })));
2026-03-10 17:10:11 +00:00
const CustomerView = lazy(() => import("./view").then((m) => ({ default: m.CustomerViewPage })));
2025-08-11 17:49:52 +00:00
2026-03-07 18:27:23 +00:00
//const CustomerAdd = lazy(() => import("./pages").then((m) => ({ default: m.CustomerCreatePage })));
2026-03-16 17:45:45 +00:00
const CustomerUpdate = lazy(() =>
import("./update").then((m) => ({ default: m.CustomerUpdatePage }))
);
2025-08-11 17:49:52 +00:00
export const CustomerRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "customers",
element: (
2026-03-07 18:27:23 +00:00
<CustomerLayout>
2025-08-11 17:49:52 +00:00
<Outlet context={params} />
2026-03-07 18:27:23 +00:00
</CustomerLayout>
2025-08-11 17:49:52 +00:00
),
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 /> },
2026-03-10 17:10:11 +00:00
{ path: ":id", element: <CustomerView /> },
2026-03-16 17:45:45 +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 /> },*/
],
},
];
};