import React, { useState, useEffect } from "react"; import { UserRole } from "../types"; import { useAuth } from "../contexts/AuthContext"; import { Menu, X, LogOut, User } from "lucide-react"; import { Button } from "./Button"; interface NavbarProps { onNavigate: (page: string) => void; currentPage: string; } export const Navbar: React.FC = ({ onNavigate, currentPage }) => { const { user, logout } = useAuth(); const [isScrolled, setIsScrolled] = useState(false); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const [isAccountDropdownOpen, setIsAccountDropdownOpen] = useState(false); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 20); }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const getLinks = () => { if (!user) return []; switch (user.role) { case UserRole.SUPERADMIN: case UserRole.BUSINESS_OWNER: return [ { name: "Gestão de Eventos", path: "dashboard" }, { name: "Equipe & Fotógrafos", path: "team" }, { name: "Financeiro", path: "finance" }, { name: "Configurações", path: "settings" }, ]; case UserRole.EVENT_OWNER: return [ { name: "Meus Eventos", path: "dashboard" }, { name: "Solicitar Evento", path: "request-event" }, ]; case UserRole.PHOTOGRAPHER: return [ { name: "Eventos Designados", path: "dashboard" }, { name: "Agenda", path: "calendar" }, ]; default: return []; } }; const getRoleLabel = () => { if (!user) return ""; if (user.role === UserRole.BUSINESS_OWNER) return "Empresa"; if (user.role === UserRole.EVENT_OWNER) return "Cliente"; if (user.role === UserRole.PHOTOGRAPHER) return "Fotógrafo"; if (user.role === UserRole.SUPERADMIN) return "Super Admin"; return ""; }; return ( ); };