21 lines
724 B
TypeScript
21 lines
724 B
TypeScript
// lib/breadcrumb-map.ts
|
|
export const breadcrumbMap: Record<string, string> = {
|
|
'dashboard': 'Dashboard',
|
|
'settings': 'Settings',
|
|
'demo': 'Demo',
|
|
'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
|
|
};
|