import React, { useState, useRef } from 'react'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import { useLocation } from '@docusaurus/router'; import { sidebarSections } from './sidebar-config'; import TableOfContents from './TableOfContents'; interface ComponentLayoutProps { title: string; description?: string; children: React.ReactNode; } export default function ComponentLayout({ title, description, children }: ComponentLayoutProps) { const [sidebarOpen, setSidebarOpen] = useState(false); const contentRef = useRef(null); const { pathname: currentPath } = useLocation(); const { ScrollArea } = require('../../../../../ui-next/src/components/ScrollArea'); return (
{/* Mobile sidebar toggle */} {/* Mobile overlay */} {sidebarOpen && (
setSidebarOpen(false)} /> )} {/* Sidebar */} {/* Content */}
{children}
{/* Right-hand table of contents */}
); }