docs: remove duplicate buttons in code actions (#10061)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-11-13 10:59:14 +02:00
1 parent e10fb34eb9
commit 1d87459951
2 files changed
+4 -1

No files matched your search

@@ -17,6 +17,7 @@ type CodeBlockHeaderProps = {
title?: string title?: string
blockStyle?: CodeBlockStyle blockStyle?: CodeBlockStyle
actionsProps: CodeBlockActionsProps actionsProps: CodeBlockActionsProps
hideActions?: boolean
} & CodeBlockHeaderMeta } & CodeBlockHeaderMeta
export const CodeBlockHeader = ({ export const CodeBlockHeader = ({
@@ -25,6 +26,7 @@ export const CodeBlockHeader = ({
badgeLabel, badgeLabel,
actionsProps, actionsProps,
badgeColor, badgeColor,
hideActions = false
}: CodeBlockHeaderProps) => { }: CodeBlockHeaderProps) => {
const { colorMode } = useColorMode() const { colorMode } = useColorMode()
@@ -54,7 +56,7 @@ export const CodeBlockHeader = ({
</div> </div>
)} )}
</div> </div>
<CodeBlockActions {...actionsProps} /> {!hideActions && <CodeBlockActions {...actionsProps} />}
</CodeBlockHeaderWrapper> </CodeBlockHeaderWrapper>
) )
} }
@@ -363,6 +363,7 @@ export const CodeBlock = ({
...actionsProps, ...actionsProps,
inHeader: true, inHeader: true,
}} }}
hideActions={hasTabs}
/> />
)} )}
<div <div