File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed
webview-ui/src/components/common Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useDebounceEffect } from "@src/utils/useDebounceEffect"
44import styled from "styled-components"
55import { vscode } from "@src/utils/vscode"
66import { useAppTranslation } from "@src/i18n/TranslationContext"
7+ import CodeBlock from "./CodeBlock"
78
89const 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-
313296const CopyButton = styled . button `
314297 padding: 3px;
315298 height: 24px;
You can’t perform that action at this time.
0 commit comments