'use client'
import React from "react";
import {
Navbar as MTNavbar,
Collapse,
Button,
IconButton,
Typography,
} from "@material-tailwind/react";
import {
RectangleStackIcon,
UserCircleIcon,
CommandLineIcon,
Squares2X2Icon,
XMarkIcon,
Bars3Icon,
} from "@heroicons/react/24/solid";
interface NavItemProps {
children: React.ReactNode;
href?: string;
}
function NavItem({ children, href }: NavItemProps) {
return (
{children}
);
}
const NAV_MENU = [
{
name: "Page",
icon: RectangleStackIcon,
},
{
name: "Account",
icon: UserCircleIcon,
},
{
name: "Docs",
icon: CommandLineIcon,
href: "https://www.material-tailwind.com/docs/react/installation",
},
];
const Navbar =()=> {
const [open, setOpen] = React.useState(false);
const [isScrolling, setIsScrolling] = React.useState(false);
const handleOpen = () => setOpen((cur:any) => !cur);
React.useEffect(() => {
window.addEventListener(
"resize",
() => window.innerWidth >= 960 && setOpen(false)
);
}, []);
React.useEffect(() => {
function handleScroll() {
if (window.scrollY > 0) {
setIsScrolling(true);
} else {
setIsScrolling(false);
}
}
window.addEventListener("scroll", handleScroll);
return () => window.removeEventListener("scroll", handleScroll);
}, []);
return (
<>
Research-Index
{NAV_MENU.map(({ name, icon: Icon, href }) => (
{name}
))}
{/*
*/}
{open ? (
) : (
)}
{NAV_MENU.map(({ name, icon: Icon, href }) => (
{name}
))}
>
);
}
export default Navbar;