import React, { useState, useEffect } from 'react'; import { GUIDE_CONTENT } from '../constants'; import { Leaf, Menu, X, GitBranch, ArrowRight } from 'lucide-react'; export const Sidebar: React.FC = () => { const [activeId, setActiveId] = useState(''); const [isMobileOpen, setIsMobileOpen] = useState(false); useEffect(() => { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { setActiveId(entry.target.id); } }); }, { rootMargin: '-20% 0px -60% 0px' } ); GUIDE_CONTENT.forEach((section) => { const element = document.getElementById(section.id); if (element) observer.observe(element); }); return () => observer.disconnect(); }, []); const scrollToSection = (id: string) => { const element = document.getElementById(id); if (element) { element.scrollIntoView({ behavior: 'smooth' }); setIsMobileOpen(false); } }; return ( <> {/* Mobile Toggle & Drawer (unchanged logic, adjusted styling for mobile-only) */}
{isMobileOpen && (
setIsMobileOpen(false)} /> )} {/* Mobile Sidebar Content */} {/* NEW: Minimal Desktop Navigation */} ); };