import React, { useState, useEffect } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Menu, X, Sun, Moon } from 'lucide-react'; import SmoothScheduleLogo from '../SmoothScheduleLogo'; import LanguageSelector from '../LanguageSelector'; interface NavbarProps { darkMode: boolean; toggleTheme: () => void; } const Navbar: React.FC = ({ darkMode, toggleTheme }) => { const { t } = useTranslation(); const location = useLocation(); const [isMenuOpen, setIsMenuOpen] = useState(false); const [isScrolled, setIsScrolled] = useState(false); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 10); }; window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []); // Close mobile menu on route change useEffect(() => { setIsMenuOpen(false); }, [location.pathname]); const navLinks = [ { to: '/features', label: t('marketing.nav.features') }, { to: '/pricing', label: t('marketing.nav.pricing') }, { to: '/about', label: t('marketing.nav.about') }, { to: '/contact', label: t('marketing.nav.contact') }, ]; const isActive = (path: string) => location.pathname === path; return ( ); }; export default Navbar;