1
- import { ComponentProps , FC } from "react" ;
1
+ import { type ComponentProps , type FC } from "react" ;
2
2
import Editor , { DiffEditor , loader } from "@monaco-editor/react" ;
3
3
import * as monaco from "monaco-editor" ;
4
4
import { useCoderTheme } from "./coderTheme" ;
5
- import { makeStyles } from "@mui/styles" ;
6
5
7
6
loader . config ( { monaco } ) ;
8
7
@@ -13,7 +12,6 @@ export const SyntaxHighlighter: FC<{
13
12
ComponentProps < typeof DiffEditor > ;
14
13
compareWith ?: string ;
15
14
} > = ( { value, compareWith, language, editorProps } ) => {
16
- const styles = useStyles ( ) ;
17
15
const hasDiff = compareWith && value !== compareWith ;
18
16
const coderTheme = useCoderTheme ( ) ;
19
17
const commonProps = {
@@ -35,7 +33,13 @@ export const SyntaxHighlighter: FC<{
35
33
}
36
34
37
35
return (
38
- < div className = { styles . wrapper } >
36
+ < div
37
+ css = { ( theme ) => ( {
38
+ padding : theme . spacing ( 1 , 0 ) ,
39
+ background : theme . palette . background . paper ,
40
+ height : "100%" ,
41
+ } ) }
42
+ >
39
43
{ hasDiff ? (
40
44
< DiffEditor original = { compareWith } modified = { value } { ...commonProps } />
41
45
) : (
@@ -44,11 +48,3 @@ export const SyntaxHighlighter: FC<{
44
48
</ div >
45
49
) ;
46
50
} ;
47
-
48
- const useStyles = makeStyles ( ( theme ) => ( {
49
- wrapper : {
50
- padding : theme . spacing ( 1 , 0 ) ,
51
- background : theme . palette . background . paper ,
52
- height : "100%" ,
53
- } ,
54
- } ) ) ;
0 commit comments