"use client"; import Image from "next/image"; import { FC, useEffect, useRef, useState } from "react"; import { motion } from "framer-motion"; import Link from "next/link"; import MobileMenu from "./MobileMenu"; import NavItems from "./NavItems"; const NavBar: FC = () => { const scrollPos = useRef(0); const [hidden, setHidden] = useState(false); useEffect(() => { const handleScroll = (e: Event) => { const target = e.currentTarget as Window; if (target.scrollY > scrollPos.current) { setHidden(true); } else { setHidden(false); } scrollPos.current = target.scrollY; }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); return ( ); }; export default NavBar;