"use client"; import Image from "next/image"; import logoImg from "../../public/assets/logo/full_wlogo.png"; import Link from "next/link"; import { motion } from "framer-motion"; import { usePrivy } from "@privy-io/react-auth"; import { useRouter } from 'next/navigation'; // import axios from "axios"; import Cookies from "js-cookie"; import { useEffect, useState } from "react"; // import { HoverBorderGradient } from "@/components/ui/animations/hover-border-gradient"; export default function Header() { const privy = usePrivy(); const router = useRouter(); const [activeSection, setActiveSection] = useState(""); const [isCopied, setIsCopied] = useState(false); // const [CA, setCA] = useState(""); // const handleLogin = useCallback(() => privy.login(), [privy]); // useEffect(() => { // axios.get("https://catools.dev3vds1.link/get/almaze-labs") // .then(response => { // const data = response.data // if (data) { // // console.log(`this is the data addr : ${data.address}`) // setCA(data.address); // } // }) // .catch(error => { // console.error("Error fetching CA:", error); // }); // }, []); useEffect(() => { if (privy?.ready) { if (privy.authenticated) { localStorage.setItem('useremail', privy.user?.email?.address ?? "Guest"); Cookies.set('privy-authenticated', 'true', { path: '/', expires: 1 }); router.push('/dashboard'); } } }, [privy.ready, privy.authenticated, router]); // Smooth scroll function const scrollToSection = (sectionId: string) => { const element = document.getElementById(sectionId); if (element) { setActiveSection(sectionId); element.scrollIntoView({ behavior: "smooth", block: "start", }); } }; useEffect(() => { if (isCopied) { setTimeout(() => { setIsCopied(false); }, 3000); } }); // Intersection Observer to detect active section useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { setActiveSection(entry.target.id); } }); }, { threshold: 0.5 } ); const sections = ["features", "tokenomics"]; sections.forEach((section) => { const element = document.getElementById(section); if (element) observer.observe(element); }); return () => observer.disconnect(); }, []); const navItems = [ { name: "Features", href: "features", isExternal: false }, { name: "Tokenomics", href: "tokenomics", isExternal: false }, { name: "Socials", href: "footer", isExternal: false }, { name: "Docs", href: "https://dotbase-ai.gitbook.io/dotbase", isExternal: true }, ]; return ( {/* Dark gradient background with glow */}
{/* Glow effect layer */}
dotbase-logo
    {navItems.map((item) => (
  • {item.isExternal ? ( {item.name} {activeSection === item.href && ( )} ) : ( scrollToSection(item.href)} className={`relative py-1.5 px-2 rounded-md text-sm font-medium text-white transition-colors duration-200 ${ activeSection === item.href ? "text-purple-700" : "" }`} whileHover={{ scale: 1.05 }} transition={{ type: "spring", stiffness: 400, damping: 10 }} > {item.name} {activeSection === item.href && ( )} )}
  • ))}
{/*
*/}
); }