seahaven-ap/src/layout/nav.ts

38 lines
1.1 KiB
TypeScript

import type { Path } from "@/router";
export type NavModule = {
label: string;
to: Path;
testId: string;
};
export const navModules: NavModule[] = [
{ label: "Procurement", to: "/procurement", testId: "nav-procurement" },
{
label: "Invoice Processing",
to: "/",
testId: "nav-invoice-processing",
},
{
label: "Payment Processing",
to: "/payments",
testId: "nav-payment-processing",
},
{ label: "Approvals", to: "/approvals", testId: "nav-approvals" },
{ label: "Vendor Management", to: "/settings/vendors", testId: "nav-vendors" },
{ label: "Recurring Invoices", to: "/recurring", testId: "nav-recurring" },
{ label: "My Past Invoices", to: "/past-invoices", testId: "nav-past-invoices" },
{ label: "Dashboards & Reports", to: "/reports", testId: "nav-reports" },
{ label: "System Settings", to: "/settings", testId: "nav-settings" },
];
/** Format a nav count badge: hide at 0, cap at 99+. */
export function formatNavBadgeCount(count: number): string | undefined {
if (count <= 0) {
return undefined;
}
if (count >= 100) {
return "99+";
}
return String(count);
}