'use client'; import React from 'react'; import Link from 'next/link'; import {usePathname, useRouter} from 'next/navigation'; import {Button} from '@/components/ui/button'; import {Sheet, SheetContent, SheetTrigger} from '@/components/ui/sheet'; import {Menu} from 'lucide-react'; import {ThemeToggle} from '@/components/theme-toggle'; const navLinks = [ {id: 'services', label: 'Leistungen'}, {id: 'about', label: 'Über uns'}, {id: 'process', label: 'Ablauf'}, {id: 'whyus', label: 'Warum wir'}, {id: 'referral', label: 'Empfehlung'}, {id: 'faq', label: 'FAQ'}, ]; const Navbar = () => { const pathname = usePathname(); const router = useRouter(); const handleNavClick = (id: string) => { if (typeof window === 'undefined') return if (pathname === '/') { const el = document.getElementById(id) if (el) { el.scrollIntoView({behavior: 'smooth', block: 'start'}) } } else { localStorage.setItem('scrollToId', id) router.push('/') } } return (