import { Link, useRouterState } from "@tanstack/react-router"; import { useState } from "react"; import { Menu, X, Eye } from "lucide-react"; import { Button } from "@/components/ui/button"; const navLinks = [ { to: "/", label: "Home" }, { to: "/how-it-works", label: "How It Works" }, { to: "/why-safesight", label: "Why SafeSight" }, { to: "/about", label: "About" }, { to: "/pricing", label: "Pricing" }, { to: "/download", label: "Download" }, { to: "/contact", label: "Contact" }, ]; export function SiteHeader() { const [mobileOpen, setMobileOpen] = useState(false); const pathname = useRouterState({ select: (s) => s.location.pathname }); return (
SafeSight {/* Desktop nav */}
{/* Mobile menu button */}
{/* Mobile nav */} {mobileOpen && (
{navLinks.map((link) => ( setMobileOpen(false)} className={`block rounded-md px-3 py-2 text-base ${ pathname === link.to || (link.to !== "/" && pathname.startsWith(link.to)) ? "bg-muted font-medium text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground" }`} > {link.label} ))}
setMobileOpen(false)}> setMobileOpen(false)}>
)}
); }