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] */}
{/* ── 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.email}
) : (
)}
)}
>
);
}