import React, { useState } from 'react' import NovaSelect from '../ui/NovaSelect' function jumpToSection(targetId) { if (!targetId || typeof window === 'undefined') return const element = document.getElementById(targetId) if (!element) return element.scrollIntoView({ behavior: 'smooth', block: 'start' }) window.history.replaceState(null, '', `#${targetId}`) } export default function DocsSidebarNav({ sections, ariaLabel = 'Sections on this page', selectLabel = 'Jump to section', navTitle = 'On this page' }) { const [selectedSection, setSelectedSection] = useState(null) return ( <>
({ value: section.id, label: section.label }))} onChange={(value) => { jumpToSection(value) setSelectedSection(null) }} searchable={false} />
) }