'use client'; import React, { useState, Fragment } from 'react'; import Link from 'next/link'; import type { Route } from 'next'; import { Dialog, Transition } from '@headlessui/react'; import { BotSwitcher, SiteMenuDropdown } from '@/components/navigation'; import { Logo } from '@/components/shared/Logo'; import { menuItems } from '@/data/menuItems'; import { useScrollNavigation, getNavColors } from '@/lib/hooks'; import type { BotMenuItem } from '@/types/bot'; interface BotNavigationProps { botSlug: string; botTitle: string; botEmoji: string; botDescription?: string; menuItems: BotMenuItem[]; chatLink?: string; sections?: boolean; } /** * Reusable navigation component for bot detail pages * Uses shared scroll navigation hook and centralized color config */ export const BotNavigation: React.FC = ({ botSlug, botTitle, botEmoji, botDescription: _botDescription = '', menuItems: sectionMenuItems, chatLink, sections = true, }) => { const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); // Use shared scroll navigation hook const { activeSection, isScrolled, scrollToSection } = useScrollNavigation({ menuItems: sectionMenuItems, scrollOffset: 300, enabled: sections, }); // Filter site nav items (exclude button items like "Contact Us") const siteNavItems = menuItems.filter((item) => !item.isButton); // Handle scroll to section with mobile menu close const handleScrollToSection = (sectionId: string | undefined) => { scrollToSection(sectionId); setIsMobileMenuOpen(false); }; // Get color classes from centralized config const colors = getNavColors(); const navClasses = isScrolled ? 'bg-surface shadow-md border-b border-edge' : 'bg-surface border-b border-edge'; return ( ); }; // Named export for consistency with best practices // Default export kept for backwards compatibility with existing imports export default BotNavigation;