'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useState } from 'react'; import { BookOpen, Check, ChevronsUpDown, Code2, GraduationCap, Server } from 'lucide-react'; import { Popover, PopoverContent, PopoverTrigger } from 'fumadocs-ui/components/ui/popover'; import { cn } from '@/lib/cn'; // The four doc sections; the header switcher moves between them from any page. const SECTIONS = [ { prefix: '/guides', href: '/guides/', name: 'Guides', text: 'Using the product, step by step', icon: BookOpen }, { prefix: '/learn', href: '/learn/email-warmup/', name: 'Learn', text: 'Cold email and deliverability basics', icon: GraduationCap }, { prefix: '/api', href: '/api/', name: 'API reference', text: 'REST API, SDKs, webhooks, CLI and MCP', icon: Code2 }, { prefix: '/development', href: '/development/install/', name: 'Self-hosting', text: 'Install and run your own instance', icon: Server }, ]; export function SectionSwitcher() { const pathname = usePathname(); const [open, setOpen] = useState(false); const current = SECTIONS.find((s) => pathname.startsWith(s.prefix)) ?? SECTIONS[0]; const Icon = current.icon; return (