forked from TypeStrong/typedoc
/
hierarchy.tsx
21 lines (20 loc) · 871 Bytes
/
hierarchy.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
import { JSX } from "../../../../utils";
import type { DeclarationHierarchy } from "../../../../models";
export const hierarchy = (context: DefaultThemeRenderContext, props: DeclarationHierarchy | undefined) => (
<>
{!!props && (
<section class="tsd-panel tsd-hierarchy">
<h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
{props.types.map((item, i, l) => (
<li>
{props.isTarget ? <span class="target">{item.toString()}</span> : context.type(item)}
{i === l.length - 1 && !!props.next && context.hierarchy(props.next)}
</li>
))}
</ul>
</section>
)}
</>
);