diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 442defafc..254cff3a5 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -355,17 +355,30 @@ export const DocsNav = ({ } }, [resolvedTheme]); + /* Accordion helper: Auto-collapse other sections when opening a new one */ + const handleAccordionChange = (key: keyof typeof active, isOpen: boolean) => { + if (isOpen) { + setActive({ + getDocs: key === 'getDocs', + getStarted: key === 'getStarted', + getGuides: key === 'getGuides', + getReference: key === 'getReference', + getSpecification: key === 'getSpecification', + }); + } else { + setActive((prev) => ({ + ...prev, + [key]: false, + })); + } + }; + return (