Fix copy for code blocks in OpenAPI or AI answers (#2250)

This commit is contained in:
Samy Pessé
2024-03-28 21:46:29 +00:00
committed by GitHub
parent d0ef225ea3
commit 5805c24255
@@ -1,4 +1,5 @@
import { DocumentBlockCode, JSONDocument } from '@gitbook/api';
import { useId } from 'react';
import { CodeBlock } from './CodeBlock';
@@ -8,8 +9,10 @@ import { CodeBlock } from './CodeBlock';
*/
export function PlainCodeBlock(props: { code: string; syntax: string }) {
const { code, syntax } = props;
const id = useId();
const block: DocumentBlockCode = {
key: id,
object: 'block',
type: 'code',
data: {