import clsx from "clsx"; import { motion, useScroll, useTransform } from "framer-motion"; import Link from "next/link"; import { type ComponentRef, type CSSProperties, forwardRef, type ReactNode, } from "react"; import { Button } from "./Button"; import { Logo } from "./Logo"; import { MobileNavigation, useIsInsideMobileNavigation, useMobileNavigationStore, } from "./MobileNavigation"; import { MobileSearch, Search } from "./Search"; import { ThemeToggle } from "./ThemeToggle"; function TopLevelNavItem({ href, children, }: { href: string; children: ReactNode; }) { return (
  • {children}
  • ); } export const Header = forwardRef, { className?: string }>( function Header({ className }, ref) { const { isOpen: mobileNavIsOpen } = useMobileNavigationStore(); const isInsideMobileNavigation = useIsInsideMobileNavigation(); const { scrollY } = useScroll(); const bgOpacityLight = useTransform(scrollY, [0, 72], [0.5, 0.9]); const bgOpacityDark = useTransform(scrollY, [0, 72], [0.2, 0.8]); return (
    ); }, );