import React, { useState, useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { useAuth } from "../context/AuthContext"; const NAV_LINKS = [ { label: "Home", href: "#home" }, { label: "Capabilities", href: "#capabilities" }, ]; // SVG Icons const GithubIcon = () => ( ); const LinkedinIcon = () => ( ); const RepoIcon = () => ( ); const MenuIcon = () => ( ); const CloseIcon = () => ( ); // Inline neural magnifying glass — transparent bg, blends with page const AgentBondLogo = ({ className = "" }) => (
{/* Icon: transparent neural magnifying glass */} {/* Wordmark */}
AgentBond
); export default function Navbar({ onOpenAuth, currentView, onViewChange }) { const { user, logout } = useAuth(); const [menuOpen, setMenuOpen] = useState(false); const [scrolled, setScrolled] = useState(false); useEffect(() => { const handleScroll = () => setScrolled(window.scrollY > 40); window.addEventListener("scroll", handleScroll, { passive: true }); return () => window.removeEventListener("scroll", handleScroll); }, []); const handleNavClick = (href) => { setMenuOpen(false); const el = document.querySelector(href); if (el) { el.scrollIntoView({ behavior: "smooth" }); } }; const links = [ { label: "Home", href: "#home", view: "landing" }, { label: "Capabilities", href: "#capabilities", view: "landing" }, ...(user ? [{ label: "Workspace", href: "#workspace", view: "workspace" }] : []), ]; return ( <> {/* 3-column grid: [Logo] [Nav Pill centered] [Icons] */}
{/* ── COL 1: Logo ── */} { e.preventDefault(); if (onViewChange) { onViewChange("landing", "#home"); } else { handleNavClick("#home"); } }} className="justify-self-start hover:opacity-85 transition-opacity duration-200" aria-label="AgentBond AI — Go to home" > {/* ── COL 2: Nav pill — guaranteed screen center ── */}
{links.map((item) => ( { e.preventDefault(); if (onViewChange) { onViewChange(item.view, item.href); } else { handleNavClick(item.href); } }} className={`px-4 py-2 text-sm font-medium font-body rounded-full transition-all duration-200 ${ currentView === item.view ? "text-white bg-white/[0.08]" : "text-white/80 hover:text-white hover:bg-white/[0.08]" }`} > {item.label} ))} {/* Separator */} {/* CTA inside nav pill */} {user ? (
{user.name} {user.name}
) : ( )}
{/* ── COL 3: Social icons + Mobile hamburger ── */}
{/* ── Mobile Menu toggle button ── */}
{/* ── Mobile Menu Drawer ── */} {menuOpen && ( {/* Brand header inside mobile menu */}
{links.map((item) => ( { e.preventDefault(); setMenuOpen(false); if (onViewChange) { onViewChange(item.view, item.href); } else { handleNavClick(item.href); } }} className={`px-4 py-3 rounded-xl text-sm font-medium font-body transition-all ${ currentView === item.view ? "text-white bg-white/[0.08]" : "text-white/90 hover:bg-white/[0.08] hover:text-white" }`} > {item.label} ))}
LinkedIn — Karan Shelar GitHub — Edge-Explorer AgentBond-AI Repo
{user ? (
{user.name}
{user.name} {user.email}
) : ( )} )} ); }