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

61 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(() =>
import("./components").then((m) => ({ default: m.InvoicesLayout }))
2025-06-11 15:13:44 +00:00
);
2025-06-24 18:38:57 +00:00
2025-11-11 18:57:04 +00:00
const InvoiceListPage = lazy(() => import("./pages").then((m) => ({ default: m.InvoiceListPage })));
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: [
{ path: "", index: true, element: <ProformasListPage /> }, // index
{ path: "list", element: <ProformasListPage /> },
{ path: "create", element: <CustomerInvoiceAdd /> },
{ path: ":id/edit", element: <InvoiceUpdatePage /> },
],
},
2025-06-11 15:13:44 +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-10-18 19:57:52 +00:00
{ path: "", index: true, element: <InvoiceListPage /> }, // index
{ path: "list", element: <InvoiceListPage /> },
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 /> },*/
],
},
];
};