'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 (
{}}
onPointerLeaveCapture={() => {}}
as="a"
href={href || "#"}
target={href ? "_blank" : "_self"}
variant="paragraph"
className="flex items-center gap-2 font-medium"
>
{children}
);
}
const NAV_MENU = [
// {
// name: "Page",
// icon: RectangleStackIcon,
// },
// {
// name: "Account",
// icon: UserCircleIcon,
// },
{
name: "Add New Paper",
icon: RectangleStackIcon,
href: "https://huggingface.co/spaces/ameerazam08/research-index/blob/main/README.md",
},
];
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 (
<>
{}}
onPointerLeaveCapture={() => {}}
placeholder=''
shadow={false}
fullWidth
blurred={false}
color={isScrolling ? "white" : "transparent"}
className="fixed top-0 z-50 border-0"
>
{}}
onPointerLeaveCapture={() => {}}
placeholder="hello"
color={isScrolling ? "blue-gray" : "white"}
className="text-lg font-bold"
>
Research-Index
{NAV_MENU.map(({ name, icon: Icon, href }) => (
{name}
))}
{/*
*/}
{}}
onPointerLeaveCapture={() => {}}
variant="text"
color={isScrolling ? "gray" : "white"}
onClick={handleOpen}
className="ml-auto inline-block lg:hidden"
>
{open ? (
) : (
)}
{NAV_MENU.map(({ name, icon: Icon, href }) => (
{name}
))}
>
);
}
export default Navbar;