import { useState, useEffect } from 'react'; import { Menu, X, ChevronDown, Globe } from 'lucide-react'; import { motion, AnimatePresence } from 'motion/react'; import { Button } from './ui/button'; import { ImageWithFallback } from './figma/ImageWithFallback'; import logoImage from 'figma:asset/e96a0ba8c1e8ee053e3eb462a3b4552a8657e7b6.png'; interface SimpleNavbarProps { onHomeClick?: () => void; onMelbourneClick?: () => void; onPassesClick?: () => void; onSignInClick?: () => void; onAttractionsClick?: () => void; currentPage?: string; } export function Navbar({ onHomeClick, onMelbourneClick, onPassesClick, onSignInClick, onAttractionsClick, currentPage = 'home' }: SimpleNavbarProps) { const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const [isScrolled, setIsScrolled] = useState(false); // Handle scroll effect useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 0); }; window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []); const navItems = [ { label: 'Home', action: onHomeClick, active: currentPage === 'home' }, { label: 'Melbourne', action: onMelbourneClick, active: currentPage === 'melbourne' }, { label: 'Attractions', action: onAttractionsClick, active: currentPage === 'attractions' }, { label: 'Passes', action: onPassesClick, active: currentPage === 'passes' } ]; return (
{/* Logo */} {/* Desktop Navigation */}
{navItems.map((item) => ( {item.label} {item.active && ( )} ))}
{/* Right Section */}
ENG
{/* Mobile Menu Button */}
{/* Mobile Menu */} {isMobileMenuOpen && (
{navItems.map((item) => ( { item.action?.(); setIsMobileMenuOpen(false); }} className={`block w-full text-left px-3 py-2 rounded-md font-medium transition-colors duration-200 ${ item.active ? 'text-primary bg-primary/10' : 'text-gray-700 hover:text-gray-900 hover:bg-gray-50' }`} whileHover={{ x: 4 }} > {item.label} ))}
)}
); }