import { Link, NavLink, useNavigate } from "react-router-dom"; import { useAuth } from "../lib/auth"; import { useProfile } from "../lib/profile"; import { Search, LogOut, Upload, Users, Settings as SettingsIcon } from "lucide-react"; import { useState, useEffect } from "react"; export const Navbar = () => { const { user, logout } = useAuth(); const { active, clearActive } = useProfile(); const nav = useNavigate(); const [scrolled, setScrolled] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 20); window.addEventListener("scroll", onScroll); return () => window.removeEventListener("scroll", onScroll); }, []); const linkClass = ({ isActive }) => `text-sm tracking-wide transition-colors duration-300 ${isActive ? "text-white" : "text-[#8A8A8A] hover:text-white"}`; const switchProfile = () => { clearActive(); nav("/profile"); }; return (
Kino . {user && ( )}
{user ? (
{user.is_admin && ( <> )}
) : ( Sign in )}
); }; export default Navbar;