mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 07:35:16 +00:00
70c6c9df42
* Start * Try webframe * Lint and format * Move to package * Continue * Implement card and cleanup contexts * Start code blocks * Start rendering image * Continue with card * Start stack * Start text * Start modal * Format * Continue * Fix TS errors * Cleanup * Make markdown work with server components * Format * Add visual test * Lint and format * Fix lifecycle * Implement textinput * Divider * Remove console logs * Remove listSpaceIntegrationsBlocks
29 lines
653 B
TypeScript
29 lines
653 B
TypeScript
import { ContentKitCodeBlock } from '@gitbook/api';
|
|
|
|
import { ContentKitClientElementProps } from './types';
|
|
|
|
export function ElementCodeBlockClient(
|
|
props: ContentKitClientElementProps<ContentKitCodeBlock> & {
|
|
/**
|
|
* Render a code block on the server as a fallback and swap only when needed.
|
|
*/
|
|
children: React.ReactNode;
|
|
},
|
|
) {
|
|
const { element, children } = props;
|
|
|
|
return <>{children}</>;
|
|
}
|
|
|
|
export function DefaultCodeBlock(props: {
|
|
code: string;
|
|
syntax: string;
|
|
lineNumbers: number | boolean;
|
|
}) {
|
|
return (
|
|
<pre>
|
|
<code>{props.code}</code>
|
|
</pre>
|
|
);
|
|
}
|