mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
27 lines
832 B
TypeScript
27 lines
832 B
TypeScript
/**
|
|
* 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 from 'react';
|
|
import DocSidebarItemCategory from '@theme/DocSidebarItem/Category';
|
|
import DocSidebarItemLink from '@theme/DocSidebarItem/Link';
|
|
import DocSidebarItemHtml from '@theme/DocSidebarItem/Html';
|
|
import type {Props} from '@theme/DocSidebarItem';
|
|
|
|
export default function DocSidebarItem({
|
|
item,
|
|
...props
|
|
}: Props): JSX.Element | null {
|
|
switch (item.type) {
|
|
case 'category':
|
|
return <DocSidebarItemCategory item={item} {...props} />;
|
|
case 'html':
|
|
return <DocSidebarItemHtml item={item} {...props} />;
|
|
case 'link':
|
|
default:
|
|
return <DocSidebarItemLink item={item} {...props} />;
|
|
}
|
|
}
|