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

62 lines
2.1 KiB
TypeScript
Raw Normal View History

2025-11-11 18:57:04 +00:00
import type { ModuleClientParams } from "@erp/core/client";
2025-06-11 15:13:44 +00:00
import { lazy } from "react";
2025-11-11 18:57:04 +00:00
import { Outlet, type RouteObject } from "react-router-dom";
2025-06-11 15:13:44 +00:00
// Lazy load components
2025-10-18 19:57:52 +00:00
const InvoicesLayout = lazy(() =>
2025-11-14 15:48:09 +00:00
import("./shared/ui").then((m) => ({ default: m.CustomerInvoicesLayout }))
2025-06-11 15:13:44 +00:00
);
2025-06-24 18:38:57 +00:00
2025-11-12 17:22:05 +00:00
const ProformaListPage = lazy(() =>
2025-11-13 11:49:36 +00:00
import("./pages").then((m) => ({ default: m.ProformaListPage }))
2025-11-12 17:22:05 +00:00
);
2025-06-24 18:38:57 +00:00
const CustomerInvoiceAdd = lazy(() =>
import("./pages").then((m) => ({ default: m.CustomerInvoiceCreate }))
);
2025-10-18 19:57:52 +00:00
const InvoiceUpdatePage = 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-11-11 18:57:04 +00:00
{
path: "proformas",
element: (
<InvoicesLayout>
<Outlet context={params} />
</InvoicesLayout>
),
children: [
2025-11-12 17:22:05 +00:00
{ path: "", index: true, element: <ProformaListPage /> }, // index
{ path: "list", element: <ProformaListPage /> },
2025-11-11 18:57:04 +00:00
{ path: "create", element: <CustomerInvoiceAdd /> },
{ path: ":id/edit", element: <InvoiceUpdatePage /> },
],
},
2025-11-13 11:49:36 +00:00
/*{
2025-06-24 18:38:57 +00:00
path: "customer-invoices",
2025-06-11 15:13:44 +00:00
element: (
2025-10-18 19:57:52 +00:00
<InvoicesLayout>
2025-06-11 15:13:44 +00:00
<Outlet context={params} />
2025-10-18 19:57:52 +00:00
</InvoicesLayout>
2025-06-11 15:13:44 +00:00
),
children: [
2025-11-12 17:22:05 +00:00
//{ path: "", index: true, element: <InvoiceListPage /> }, // index
//{ path: "list", element: <InvoiceListPage /> },
2025-06-11 15:13:44 +00:00
//
2025-11-13 11:49:36 +00:00
{ path: "create", element: <CustomerInvoicesList /> },
2025-06-11 15:13:44 +00:00
{ 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 /> },
2025-11-13 11:49:36 +00:00
{ path: ":id/preview", element: <CustomerInvoicesList /> },
2025-06-11 15:13:44 +00:00
],
2025-11-13 11:49:36 +00:00
},*/
2025-06-11 15:13:44 +00:00
];
};