Skip to content

Commit b48ad35

Browse files
committed
PR feedback
1 parent 230a923 commit b48ad35

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

webview-ui/src/components/common/MermaidBlock.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useDebounceEffect } from "@src/utils/useDebounceEffect"
44
import styled from "styled-components"
55
import { vscode } from "@src/utils/vscode"
66
import { useAppTranslation } from "@src/i18n/TranslationContext"
7+
import CodeBlock from "./CodeBlock"
78

89
const MERMAID_THEME = {
910
background: "#1e1e1e", // VS Code dark theme background
@@ -218,9 +219,7 @@ export default function MermaidBlock({ code }: MermaidBlockProps) {
218219
<div style={{ marginBottom: "8px", color: "var(--vscode-descriptionForeground)" }}>
219220
{error}
220221
</div>
221-
<CodeBlock>
222-
<code>{code}</code>
223-
</CodeBlock>
222+
<CodeBlock language="mermaid" source={code} />
224223
</div>
225224
)}
226225
</div>
@@ -294,22 +293,6 @@ const LoadingMessage = styled.div`
294293
font-size: 0.9em;
295294
`
296295

297-
const CodeBlock = styled.pre`
298-
background-color: var(--vscode-editor-background);
299-
border: 1px solid var(--vscode-editor-lineHighlightBorder);
300-
border-radius: 3px;
301-
padding: 8px;
302-
overflow: auto;
303-
max-height: 200px;
304-
305-
code {
306-
font-family: var(--vscode-editor-font-family);
307-
font-size: var(--vscode-editor-font-size);
308-
white-space: pre-wrap;
309-
word-break: break-all;
310-
}
311-
`
312-
313296
const CopyButton = styled.button`
314297
padding: 3px;
315298
height: 24px;

0 commit comments

Comments
 (0)