import React, { useState } from "react"; import { cn } from "../lib/cn"; export interface HeaderProps { className?: string; style?: React.CSSProperties; navLinks?: Array<{ href: string; label: string }>; ctaLabel?: string; ctaHref?: string; actions?: React.ReactNode; logo?: React.ReactNode; mobileMenuContent?: React.ReactNode; } const mobileMenuStyle: React.CSSProperties = { position: "fixed", top: 72, left: 0, right: 0, bottom: 0, background: "rgba(10, 9, 13, 0.96)", backdropFilter: "blur(24px)", WebkitBackdropFilter: "blur(24px)", padding: "var(--space-8)", display: "flex", flexDirection: "column", gap: "var(--space-6)", zIndex: 200, }; const defaultLinks = [ { href: "/about", label: "About" }, { href: "/pricing", label: "Pricing" }, { href: "/network", label: "Network" }, ]; /** Responsive public navigation with desktop links, mobile drawer, and optional actions. */ export const Header = React.forwardRef( ( { className, style, navLinks, ctaLabel = "Get Started", ctaHref = "/sign-up", actions, logo, mobileMenuContent, ...props }, ref, ) => { const [mobileOpen, setMobileOpen] = useState(false); const links = navLinks || defaultLinks; const activePath = typeof window !== "undefined" ? window.location.pathname : "/"; const baseLinkStyle: React.CSSProperties = { fontSize: "var(--text-sm)", fontWeight: 500, color: "var(--text-secondary)", padding: "var(--space-2) var(--space-3)", textDecoration: "none", position: "relative", transition: "color 0.2s var(--transition-fast)", }; return (
{/* Logo */}
{logo ?? ( )}
MicProtocol
{/* Desktop Nav */} {/* Mobile Hamburger */} {/* Mobile Menu Panel */} {mobileOpen && mobileMenuContent && (
{mobileMenuContent}
)}
); }, ); Header.displayName = "Header";