docs: fix bugs in API reference (#10557)
This commit is contained in:
@@ -107,15 +107,30 @@ export const CodeTabs = ({
|
||||
return
|
||||
}
|
||||
|
||||
const codeBlockProps = codeBlock.props as CodeBlockProps
|
||||
let codeBlockProps = codeBlock.props as CodeBlockProps
|
||||
|
||||
const commonProps = {
|
||||
badgeLabel: undefined,
|
||||
hasTabs: true,
|
||||
className: clsx("!my-0", codeBlockProps.className),
|
||||
}
|
||||
|
||||
if (
|
||||
typeof codeBlock.type !== "string" &&
|
||||
"name" in codeBlock.type &&
|
||||
codeBlock.type.name === "CodeBlock"
|
||||
) {
|
||||
codeBlockProps = {
|
||||
...codeBlockProps,
|
||||
...commonProps,
|
||||
}
|
||||
}
|
||||
|
||||
const modifiedProps: CodeBlockProps = {
|
||||
...(getCodeBlockProps(codeBlock) || {
|
||||
source: "",
|
||||
}),
|
||||
badgeLabel: undefined,
|
||||
hasTabs: true,
|
||||
className: clsx("!my-0", codeBlockProps.className),
|
||||
...commonProps,
|
||||
}
|
||||
|
||||
tempTabs.push({
|
||||
|
||||
Reference in New Issue
Block a user