internal frontend implementation with keycloak authentication

This commit is contained in:
2025-07-02 02:24:35 +00:00
parent 7c3ee5357e
commit 66a415b0dd
39 changed files with 3475 additions and 59 deletions

View File

@@ -0,0 +1,28 @@
// utils/getBreadcrumbs.ts
import {breadcrumbMap} from '@/lib/breadcrumb-map';
export type Breadcrumb = {
label: string;
href: string;
isCurrentPage?: boolean;
};
export function getBreadcrumbs(path: string): Breadcrumb[] {
const pathSegments = path.split('/').filter(Boolean);
return pathSegments.map((segment, index) => {
const href = `/${pathSegments.slice(0, index + 1).join('/')}`;
// Use the mapping if it exists, otherwise format the segment
const label = breadcrumbMap[segment.toLowerCase()] ||
segment
.split('-')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
return {
label,
href,
isCurrentPage: index === pathSegments.length - 1
};
});
}