import { useEffect, useState } from 'react'; import { BookOpen, Database, Download, Menu, X } from 'lucide-react'; import { Link, useLocation } from 'react-router-dom'; export function Header() { const location = useLocation(); const [menuOpen, setMenuOpen] = useState(false); // Close the mobile menu whenever the route changes useEffect(() => { setMenuOpen(false); }, [location.pathname]); const navItemClass = (active: boolean) => `flex items-center gap-1.5 px-3 py-2 text-sm rounded-lg transition-colors ${ active ? 'bg-slate-100 text-slate-900 font-semibold' : 'text-slate-600 hover:bg-slate-50' }`; return (
MuSProt
Multistate Protein Structure Database
{/* Full nav — shown in landscape (W >= H) */} {/* Menu toggle — shown only in portrait (W < H) */}
{/* Dropdown menu — portrait only */} {menuOpen && ( )}
); }