Uecko_ERP/modules/customer-invoices/src/web/customer-invoice-routes.tsx
2025-11-21 19:42:17 +01:00

70 lines
2.4 KiB
TypeScript

import type { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, type RouteObject } from "react-router-dom";
const ProformaLayout = lazy(() =>
import("./proformas/ui").then((m) => ({ default: m.ProformaLayout }))
);
const IssuedInvoicesLayout = lazy(() =>
import("./issued-invoices/ui").then((m) => ({ default: m.IssuedInvoicesLayout }))
);
const ProformasListPage = lazy(() =>
import("./proformas/list").then((m) => ({ default: m.ProformaListPage }))
);
const IssuedInvoiceListPage = lazy(() =>
import("./issued-invoices/pages").then((m) => ({ default: m.IssuedInvoiceListPage }))
);
/*const CustomerInvoiceAdd = lazy(() =>
import("./pages").then((m) => ({ default: m.CustomerInvoiceCreate }))
);
const InvoiceUpdatePage = lazy(() =>
import("./pages").then((m) => ({ default: m.InvoiceUpdatePage }))
);*/
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "proformas",
element: (
<ProformaLayout>
<Outlet context={params} />
</ProformaLayout>
),
children: [
{ path: "", index: true, element: <ProformasListPage /> }, // index
{ path: "list", element: <ProformasListPage /> },
//{ path: "create", element: <CustomerInvoiceAdd /> },
//{ path: ":id/edit", element: <InvoiceUpdatePage /> },
],
},
{
path: "customer-invoices",
element: (
<IssuedInvoicesLayout>
<Outlet context={params} />
</IssuedInvoicesLayout>
),
children: [
{ path: "", index: true, element: <IssuedInvoiceListPage /> }, // index
{ path: "list", element: <IssuedInvoiceListPage /> },
/*
{ 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 /> },
*/
],
},
];
};