File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
uiCore/components/codeblock Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { QueryAnalysisCommands } from "./commands";
10
10
import { AltimateIcon } from "@assets/icons" ;
11
11
import { QueryAnalysisType } from "./types" ;
12
12
import { useMemo } from "react" ;
13
+ import classes from "../../datapilot.module.scss" ;
13
14
14
15
const QUERY_HAPPY_LIMIT = 10 ;
15
16
const DefaultActions = [
@@ -52,7 +53,7 @@ const QueryAnalysis = (): JSX.Element | null => {
52
53
< Stack direction = "column" >
53
54
< DatapilotHeader />
54
55
55
- < CodeBlock code = { chat . query } language = "sql" fileName = { chat . fileName } />
56
+ < CodeBlock code = { chat . query } language = "sql" fileName = { chat . fileName } classname = { classes . codeblock } />
56
57
{ showLineLimitWarning ? (
57
58
< Card >
58
59
< CardTitle >
Original file line number Diff line number Diff line change @@ -153,3 +153,7 @@ body {
153
153
}}
154
154
}
155
155
}
156
+
157
+ .codeblock {
158
+ --code-bg : transparent ;
159
+ }
Original file line number Diff line number Diff line change @@ -10,27 +10,32 @@ interface Props {
10
10
fileName ?: string ;
11
11
showLineNumbers ?: boolean ;
12
12
titleActions ?: ReactNode ;
13
+ classname ?: string ;
13
14
}
14
15
const CodeBlockComponent = ( {
15
16
code,
16
17
language,
17
18
fileName,
18
19
showLineNumbers,
19
20
titleActions,
21
+ classname
20
22
} : Props ) : JSX . Element => {
21
23
const {
22
24
state : { theme } ,
23
25
} = useAppContext ( ) ;
24
26
const codeBlockTheme = theme === Themes . Dark ? "dark" : "light" ;
27
+ const editorTheme = theme === Themes . Dark ? "vsc-dark-plus" : "vs" ;
25
28
return (
26
29
< div className = { classes . codeblock } >
27
30
< CodeblockLib
28
31
showLineNumbers = { showLineNumbers }
29
32
code = { code }
30
33
fileName = { fileName }
31
34
theme = { codeBlockTheme }
35
+ editorTheme = { editorTheme }
32
36
language = { language }
33
37
titleActions = { titleActions }
38
+ className = { classname }
34
39
/>
35
40
</ div >
36
41
) ;
You can’t perform that action at this time.
0 commit comments