mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 20:37:44 +00:00
docs: remove copy button from disabled code blocks (#4516)
This commit is contained in:
committed by
GitHub
parent
a7eaa049e4
commit
6e60de4205
@@ -34,6 +34,12 @@ export interface DynamicCodeblockProps {
|
||||
* @defaultValue true
|
||||
*/
|
||||
wrapInSuspense?: boolean;
|
||||
/**
|
||||
* Allow to copy code with copy button
|
||||
*
|
||||
* @defaultValue true
|
||||
*/
|
||||
allowCopy?: boolean;
|
||||
options?: Omit<HighlightOptionsCommon, "lang"> & HighlightOptionsThemes;
|
||||
}
|
||||
|
||||
@@ -63,6 +69,7 @@ export function DynamicCodeBlock({
|
||||
codeblock,
|
||||
options,
|
||||
wrapInSuspense = true,
|
||||
allowCopy = true,
|
||||
}: DynamicCodeblockProps) {
|
||||
const shikiOptions = {
|
||||
lang,
|
||||
@@ -85,7 +92,9 @@ export function DynamicCodeBlock({
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
return <PropsContext value={codeblock}>{children}</PropsContext>;
|
||||
return (
|
||||
<PropsContext value={{ ...codeblock, allowCopy }}>{children}</PropsContext>
|
||||
);
|
||||
}
|
||||
|
||||
function Placeholder({
|
||||
|
||||
Reference in New Issue
Block a user