import { useState, useEffect } from "react"; import { Button } from "@/components/ui/button"; interface NavigationProps { profile: { name: string; }; } export function Navigation({ profile }: NavigationProps) { const [activeSection, setActiveSection] = useState("about"); useEffect(() => { const handleScroll = () => { const sections = [ "about", "experience", "projects", "businesses", "contact", ]; const scrollPosition = window.scrollY + 100; for (const section of sections) { const element = document.getElementById(section); if (element) { const offsetTop = element.offsetTop; const offsetBottom = offsetTop + element.offsetHeight; if (scrollPosition >= offsetTop && scrollPosition < offsetBottom) { setActiveSection(section); break; } } } }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const scrollToSection = (sectionId: string) => { const element = document.getElementById(sectionId); if (element) { element.scrollIntoView({ behavior: "smooth" }); } }; return ( ); }