Uecko_ERP/modules/customer-invoices/src/web/customer-invoice-routes.tsx

51 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-06-11 15:13:44 +00:00
import { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, RouteObject } from "react-router-dom";
// Lazy load components
const CustomerInvoicesLayout = lazy(() =>
import("./components").then((m) => ({ default: m.CustomerInvoicesLayout }))
);
2025-06-24 18:38:57 +00:00
const CustomerInvoicesList = lazy(() =>
import("./pages").then((m) => ({ default: m.CustomerInvoicesList }))
);
const CustomerInvoiceAdd = lazy(() =>
import("./pages").then((m) => ({ default: m.CustomerInvoiceCreate }))
);
2025-09-29 18:22:59 +00:00
const CustomerInvoiceUpdate = lazy(() =>
2025-10-12 10:43:06 +00:00
import("./pages").then((m) => ({ default: m.InvoiceUpdatePage }))
2025-09-29 18:22:59 +00:00
);
2025-06-11 15:13:44 +00:00
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
2025-06-24 18:38:57 +00:00
path: "customer-invoices",
2025-06-11 15:13:44 +00:00
element: (
<CustomerInvoicesLayout>
<Outlet context={params} />
</CustomerInvoicesLayout>
),
children: [
2025-06-24 18:38:57 +00:00
{ path: "", index: true, element: <CustomerInvoicesList /> }, // index
2025-06-11 15:13:44 +00:00
{ path: "list", element: <CustomerInvoicesList /> },
2025-06-24 18:38:57 +00:00
{ path: "create", element: <CustomerInvoiceAdd /> },
2025-09-29 18:22:59 +00:00
{ path: ":id/edit", element: <CustomerInvoiceUpdate /> },
2025-06-11 15:13:44 +00:00
//
/*{ path: "create", element: <CustomerInvoicesList /> },
{ path: ":id", element: <CustomerInvoicesList /> },
{ path: ":id/edit", element: <CustomerInvoicesList /> },
{ path: ":id/delete", element: <CustomerInvoicesList /> },
{ path: ":id/view", element: <CustomerInvoicesList /> },
{ path: ":id/print", element: <CustomerInvoicesList /> },
{ path: ":id/email", element: <CustomerInvoicesList /> },
{ path: ":id/download", element: <CustomerInvoicesList /> },
{ path: ":id/duplicate", element: <CustomerInvoicesList /> },
{ path: ":id/preview", element: <CustomerInvoicesList /> },*/
],
},
];
};