Customer Detail Page and Enhance dynamic breadcrumbs

This commit is contained in:
2025-07-06 17:24:12 +00:00
parent 055d19d201
commit e00142ff81
14 changed files with 934 additions and 69 deletions

View File

@@ -6,4 +6,15 @@ export const breadcrumbMap: Record<string, string> = {
'users': 'User Management',
'customers': 'Kundenübersicht',
// Add more mappings as needed
};
};
export const breadcrumbResolvers: Record<string, (id: string) => Promise<string>> = {
"customers": async (id: string) => {
const res = await fetch(`/api/customers/${id}`, {cache: "no-store"});
const customer = await res .json();
if (customer.companyName) return `Firma: ${customer.companyName}`;
if (customer.name) return `Name: ${customer.name}`;
return `ID: ${id}`;
},
// Add more mappings as needed
};