-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathExtendedExample.tsx
More file actions
36 lines (29 loc) · 755 Bytes
/
ExtendedExample.tsx
File metadata and controls
36 lines (29 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
//@ts-ignore
import CodeBlock from '@theme/CodeBlock';
//@ts-ignore
import TabItem from '@theme/TabItem';
//@ts-ignore
import Tabs from '@theme/Tabs';
interface ExtendedExampleProps {
extendedExamplesData: {
[key: string]: {
[key: string]: string;
};
};
}
const ExtendedExample = ({ extendedExamplesData }: ExtendedExampleProps) => {
const example = Object.values(extendedExamplesData)[0];
if (!example) return null;
const keys = Object.keys(example);
return (
<Tabs>
{keys.map((key) => (
<TabItem value={key} label={key} key={key}>
<CodeBlock language="jsx">{example[key]}</CodeBlock>
</TabItem>
))}
</Tabs>
);
};
export default ExtendedExample;