import { useState, useCallback } from 'react' import { Link, useNavigate, useLocation } from 'react-router-dom' import { Button } from '@/components/ui/button' import { useAuth } from '@/context/AuthContext' import { Menu, X, Mail, Sparkles } from 'lucide-react' export function Navbar() { const [isMenuOpen, setIsMenuOpen] = useState(false) const { user } = useAuth() const navigate = useNavigate() const location = useLocation() // Smooth scroll to section const scrollToSection = useCallback((sectionId: string) => { setIsMenuOpen(false) // If not on home page, navigate first if (location.pathname !== '/') { navigate('/') setTimeout(() => { const element = document.getElementById(sectionId) element?.scrollIntoView({ behavior: 'smooth', block: 'start' }) }, 100) } else { const element = document.getElementById(sectionId) element?.scrollIntoView({ behavior: 'smooth', block: 'start' }) } }, [location.pathname, navigate]) return ( ) }