mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-15 20:34:56 +02:00
25 lines
821 B
JavaScript
25 lines
821 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React, {memo} from 'react';
|
|
import {
|
|
DocSidebarItemsExpandedStateProvider,
|
|
useVisibleSidebarItems,
|
|
} from '@docusaurus/theme-common/internal';
|
|
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
function DocSidebarItems({items, ...props}) {
|
|
const visibleItems = useVisibleSidebarItems(items, props.activePath);
|
|
return (
|
|
<DocSidebarItemsExpandedStateProvider>
|
|
{visibleItems.map((item, index) => (
|
|
<DocSidebarItem key={index} item={item} index={index} {...props} />
|
|
))}
|
|
</DocSidebarItemsExpandedStateProvider>
|
|
);
|
|
}
|
|
// Optimize sidebar at each "level"
|
|
export default memo(DocSidebarItems);
|