import React, { useState, useEffect } from "react"; import Logo from "./Logo"; import Button from "./Button"; import Sidebar from "./Sidebar"; import { Sidebar as SidebarIcon } from "lucide-react"; import { Search as SearchIcon, LogIn as LogInIcon, LogOut as LogOutIcon, Settings as SettingsIcon, } from "lucide-react"; import Input from "./Input"; import AuthModal from "../Auth/AuthModal"; import { useAuth } from "../../context/AuthContext"; interface NavbarProps { variant?: "home" | "default"; } const Navbar: React.FC = ({ variant = "default", }) => { const [showAuthModal, setShowAuthModal] = useState(false); const { isLoggedIn } = useAuth(); const [showSideBar, setShowSideBar] = useState(false); useEffect(() => { if (showAuthModal) { document.body.style.overflow = "hidden"; } else { document.body.style.overflow = "unset"; } return () => { document.body.style.overflow = "unset"; }; }, [showAuthModal]); const handleLogout = () => { console.log("Logging out..."); fetch("/api/logout") .then((response) => response.json()) .then((data) => { console.log(data); window.location.reload(); }); }; const handleSideBar = () => { setShowSideBar(!showSideBar); } return ( ); }; export default Navbar;