import { useRouter } from 'next/router' import Link from 'next/link' import { useSession } from 'next-auth/react' import User from './user' const pathNameLabelMap = { '/login': 'Login', '/admin': 'Buchungsübersicht', '/admin/booking/[uuid]': 'Buchung Bearbeiten', '/admin/booking/[uuid]/bill': 'Buchung Rechnungsstellung', '/book': 'Buchungsanfrage', '/booking/[uuid]': 'Ihre Buchung', '/booking/[uuid]/stored': 'Buchungsanfrage angenommen', } function getPathNameMap(route: string) { return pathNameLabelMap[route] } export default function Navigation() { const { data, status } = useSession() const router = useRouter() const pathname = router.pathname if (pathname.length === 0 || pathname === '/') { return null } const pathLabel = getPathNameMap(pathname) return (
<>

{pathLabel}

{status === 'authenticated' && data.user.email && ( Buchungen )}
) }