import { useState } from 'react'; import { Link, useLocation, useNavigate } from 'react-router-dom'; import ThemeToggle from '../ThemeToggle'; import MobileMenu from './MobileMenu'; import { personalConfig } from '../../config/personal'; import { getTexts } from '../../config/texts'; import { scrollToSection } from '../../utils/scrollUtils'; type Props = { theme: 'light' | 'dark'; setTheme: React.Dispatch>; }; export default function Navbar({ theme, setTheme }: Readonly) { const [menuOpen, setMenuOpen] = useState(false); const location = useLocation(); const navigate = useNavigate(); const texts = getTexts(); const menuItems = texts.navigation.menuItems; function handleNavigation(section: string): void { const sectionId = section.toLowerCase(); scrollToSection(sectionId, location.pathname, navigate); // Close mobile menu if open setMenuOpen(false); } return (
{personalConfig.name}
{menuItems.map((item) => ( ))} {/* Burger Button für Mobile */}
); }