"use client"; import React, { useState, useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { MenuIcon, XIcon } from "lucide-react"; import Image from "next/image"; import { cn } from "@/lib/utils"; // Definição de Tipos para consistência de dados interface NavItem { href: string; label: string; } const navItems: NavItem[] = [ { href: "#home", label: "Home" }, { href: "#about", label: "Sobre" }, { href: "#skills", label: "Habilidades" }, { href: "#experience", label: "Experiência" }, { href: "#projects", label: "Projetos" }, { href: "#contact", label: "Contato" }, ]; export function Header() { const [isMenuOpen, setIsMenuOpen] = useState(false); const [scrolled, setScrolled] = useState(false); // Hook de detecção de scroll para mudança de estado do Header useEffect(() => { const handleScroll = () => { setScrolled(window.scrollY > 20); }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); return ( <> {/* Logo com Identidade Visual de Engenheiro */} { e.preventDefault(); const element = document.querySelector("#home"); if (element) { element.scrollIntoView({ behavior: "smooth", block: "start" }); } }} whileHover={{ scale: 1.05 }} className="flex items-center gap-2 cursor-pointer" > EVANDRO.DEV {/* Desktop Navigation - Focada em Espaçamento Ótimo */} {navItems.map((item) => ( { e.preventDefault(); const element = document.querySelector(item.href); if (element) { element.scrollIntoView({ behavior: "smooth", block: "start" }); } }} className="px-5 py-2 text-xs font-bold uppercase tracking-widest text-slate-300 hover:text-white hover:bg-white/10 rounded-full transition-all duration-300 cursor-pointer" > {item.label} ))} {/* Botão de Ação CTA (Call to Action) */} Download CV {/* Mobile Toggle */} setIsMenuOpen(!isMenuOpen)} className="md:hidden p-2 text-white bg-white/5 rounded-lg border border-white/10" > {isMenuOpen ? : } {/* Mobile Menu Overlay com Framer Motion para fluidez */} {isMenuOpen && ( setIsMenuOpen(false)} className="absolute top-8 right-8 p-4 text-white/50 hover:text-white" > {navItems.map((item, i) => ( { e.preventDefault(); setIsMenuOpen(false); const element = document.querySelector(item.href); if (element) { element.scrollIntoView({ behavior: "smooth", block: "start" }); } }} className="text-3xl font-black text-white uppercase tracking-tighter hover:text-blue-500 transition-colors cursor-pointer" > {item.label} ))} Download CV )} > ); }