Skip to content

Commit

Permalink
Fix copy for code blocks in OpenAPI or AI answers (#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse authored Mar 28, 2024
1 parent d0ef225 commit 5805c24
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/DocumentView/CodeBlock/PlainCodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DocumentBlockCode, JSONDocument } from '@gitbook/api';
import { useId } from 'react';

import { CodeBlock } from './CodeBlock';

Expand All @@ -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: {
Expand Down

0 comments on commit 5805c24

Please sign in to comment.