"use client"; import { useState } from "react"; import { Logo } from "@/components/Logo"; import { MobileMenuButton, MobileSidebar, sidebarLinkClass } from "@/components/MobileSidebar"; import { DOCS_URL } from "@/lib/plans"; const NAV_LINKS = [ { href: "#benefits", label: "Benefits" }, { href: "#download", label: "Download" }, { href: "#pricing", label: "Pricing" }, { href: "#support", label: "Support" }, ] as const; const DOCS_HREF = `${DOCS_URL.replace(/\/$/, "")}/docs/intro`; function NavAnchor({ href, label, onNavigate, className = "text-base font-medium text-gray-300 transition-colors duration-200 hover:text-white", }: { href: string; label: string; onNavigate?: () => void; className?: string; }) { const handleClick = (e: React.MouseEvent) => { e.preventDefault(); const id = href.replace("#", ""); document.getElementById(id)?.scrollIntoView({ behavior: "smooth", block: "start" }); window.history.pushState(null, "", href); onNavigate?.(); }; return ( {label} ); } function DocsLink({ onNavigate, className = "text-base font-medium text-gray-300 transition-colors duration-200 hover:text-white", }: { onNavigate?: () => void; className?: string; }) { return ( onNavigate?.()} > Docs ); } export function LandingNavbar() { const [menuOpen, setMenuOpen] = useState(false); return ( <>
setMenuOpen((prev) => !prev)} />
setMenuOpen(false)} title="Menu"> {NAV_LINKS.map(({ href, label }) => ( setMenuOpen(false)} className={sidebarLinkClass()} /> ))} setMenuOpen(false)} className={sidebarLinkClass()} /> ); }