docs: fix bugs in API reference (#10557)

This commit is contained in:
Shahed Nasser
2024-12-11 18:32:58 +02:00
committed by GitHub
parent 0264294ab5
commit cccce65ef9
26 changed files with 91 additions and 76 deletions

View File

@@ -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({