1+ import { useThemeValue } from '@gravity-ui/uikit' ;
2+ import MonacoEditor from 'react-monaco-editor' ;
3+
14import { ResponseError } from '../../../../components/Errors/ResponseError' ;
25import { LoaderWrapper } from '../../../../components/LoaderWrapper/LoaderWrapper' ;
3- import { YDBSyntaxHighlighterLazy } from '../../../../components/SyntaxHighlighter/lazy' ;
46import { configsApi } from '../../../../store/reducers/configs' ;
57import { useAutoRefreshInterval } from '../../../../utils/hooks/useAutoRefreshInterval' ;
68
79interface StartupProps {
810 database ?: string ;
911 className ?: string ;
1012}
13+
14+ const EDITOR_OPTIONS = {
15+ automaticLayout : true ,
16+ selectOnLineNumbers : true ,
17+ readOnly : true ,
18+ minimap : {
19+ enabled : false ,
20+ } ,
21+ wrappingIndent : 'indent' as const ,
22+ } ;
23+
1124export function Startup ( { database, className} : StartupProps ) {
1225 const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
26+ const theme = useThemeValue ( ) ;
1327 const { currentData, isLoading, error} = configsApi . useGetConfigQuery (
1428 { database} ,
1529 { pollingInterval : autoRefreshInterval } ,
@@ -21,13 +35,14 @@ export function Startup({database, className}: StartupProps) {
2135 < LoaderWrapper loading = { isLoading } >
2236 { error ? < ResponseError error = { error } /> : null }
2337 { startup ? (
24- < YDBSyntaxHighlighterLazy
25- className = { className }
26- language = "yaml"
27- text = { startup }
28- transparentBackground = { false }
29- withClipboardButton = { { alwaysVisible : true , withLabel : false , size : 'm' } }
30- />
38+ < div className = { className } >
39+ < MonacoEditor
40+ language = { 'yaml' }
41+ value = { startup }
42+ options = { EDITOR_OPTIONS }
43+ theme = { `vs-${ theme } ` }
44+ />
45+ </ div >
3146 ) : null }
3247 </ LoaderWrapper >
3348 ) ;
0 commit comments