Customer Detail Page and Enhance dynamic breadcrumbs
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user