'use client' import { usePathname } from 'next/navigation' import { navigation, metaModules, getModuleByHref } from '@/lib/navigation' interface HeaderProps { title?: string description?: string } export function Header({ title, description }: HeaderProps) { const pathname = usePathname() // Auto-detect title and description from navigation let pageTitle = title let pageDescription = description if (!pageTitle) { // Check meta modules first const metaModule = metaModules.find(m => pathname === m.href || pathname.startsWith(m.href + '/')) if (metaModule) { pageTitle = metaModule.name pageDescription = metaModule.description } else { // Check navigation modules const result = getModuleByHref(pathname) if (result) { pageTitle = result.module.name pageDescription = result.module.description } else { // Check category pages const category = navigation.find(cat => pathname === `/${cat.id}`) if (category) { pageTitle = category.name pageDescription = category.description } } } } return (
{pageTitle &&

{pageTitle}

} {pageDescription &&

{pageDescription}

}
{/* Search */}
{/* User Area */}
Admin Lehrer KI
A
) }