()
| 19 | } from 'lucide-react' |
| 20 | |
| 21 | export default function Header() { |
| 22 | const [isOpen, setIsOpen] = useState(false) |
| 23 | const [groupedExpanded, setGroupedExpanded] = useState< |
| 24 | Record<string, boolean> |
| 25 | >({}) |
| 26 | |
| 27 | return ( |
| 28 | <> |
| 29 | <header className="p-4 flex items-center bg-gray-800 text-white shadow-lg"> |
| 30 | <button |
| 31 | onClick={() => setIsOpen(true)} |
| 32 | className="p-2 hover:bg-gray-700 rounded-lg transition-colors" |
| 33 | aria-label="Open menu" |
| 34 | > |
| 35 | <Menu size={24} /> |
| 36 | </button> |
| 37 | <h1 className="ml-4 text-xl font-semibold"> |
| 38 | <Link to="/"> |
| 39 | <img |
| 40 | src="/tanstack-word-logo-white.svg" |
| 41 | alt="TanStack Logo" |
| 42 | className="h-10" |
| 43 | /> |
| 44 | </Link> |
| 45 | </h1> |
| 46 | </header> |
| 47 | |
| 48 | <aside |
| 49 | className={`fixed top-0 left-0 h-full w-80 bg-gray-900 text-white shadow-2xl z-50 transform transition-transform duration-300 ease-in-out flex flex-col ${ |
| 50 | isOpen ? 'translate-x-0' : '-translate-x-full' |
| 51 | }`} |
| 52 | > |
| 53 | <div className="flex items-center justify-between p-4 border-b border-gray-700"> |
| 54 | <h2 className="text-xl font-bold">Navigation</h2> |
| 55 | <button |
| 56 | onClick={() => setIsOpen(false)} |
| 57 | className="p-2 hover:bg-gray-800 rounded-lg transition-colors" |
| 58 | aria-label="Close menu" |
| 59 | > |
| 60 | <X size={24} /> |
| 61 | </button> |
| 62 | </div> |
| 63 | |
| 64 | <nav className="flex-1 p-4 overflow-y-auto"> |
| 65 | <Link |
| 66 | to="/" |
| 67 | onClick={() => setIsOpen(false)} |
| 68 | className="flex items-center gap-3 p-3 rounded-lg hover:bg-gray-800 transition-colors mb-2" |
| 69 | activeProps={{ |
| 70 | className: |
| 71 | 'flex items-center gap-3 p-3 rounded-lg bg-cyan-600 hover:bg-cyan-700 transition-colors mb-2', |
| 72 | }} |
| 73 | > |
| 74 | <Home size={20} /> |
| 75 | <span className="font-medium">Home</span> |
| 76 | </Link> |
| 77 | |
| 78 | {/* Demo Links Start */} |
nothing calls this directly
no outgoing calls
no test coverage detected