Uecko_ERP/modules/customer-invoices/src/web/customer-invoice-routes.tsx
2026-06-02 18:40:23 +02:00

93 lines
2.6 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/shared/ui").then((m) => ({ default: m.ProformaLayout }))
);
const ProformasListPage = lazy(() =>
import("./proformas/list").then((m) => ({ default: m.ListProformasPage }))
);
/*const ProformasCreatePage = lazy(() =>
import("./proformas/create").then((m) => ({ default: m.ProformaCreatePage }))
);*/
const ProformaUpdatePage = lazy(() =>
import("./proformas/update").then((m) => ({ default: m.ProformaUpdatePage }))
);
const IssuedInvoicesLayout = lazy(() =>
import("./issued-invoices/shared/ui").then((m) => ({ default: m.IssuedInvoicesLayout }))
);
const IssuedInvoiceListPage = lazy(() =>
import("./issued-invoices/list").then((m) => ({ default: m.ListIssuedInvoicesPage }))
);
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "proformas",
handle: {
layout: "app-sidebar",
protected: true,
},
element: (
<ProformaLayout>
<Outlet context={params} />
</ProformaLayout>
),
children: [
{
index: true,
element: <ProformasListPage />,
},
{
path: "list",
element: <ProformasListPage />,
},
],
},
{
path: "proformas/:id/edit",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <ProformaUpdatePage />,
},
{
path: "customer-invoices",
handle: {
layout: "app-sidebar",
protected: true,
},
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/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 /> },
*/
],
},
];
};