import React, { useRef } from 'react'; import CodeMirror from '@uiw/react-codemirror'; import { Button } from 'antd'; import { VerticalAlignBottomOutlined, VerticalAlignTopOutlined, } from '@ant-design/icons'; const SystemLog = ({ data, height, theme }: any) => { const editorRef = useRef(null); const scrollTo = (position: 'start' | 'end') => { editorRef.current.scrollDOM.scrollTo({ top: position === 'start' ? 0 : editorRef.current.scrollDOM.scrollHeight, }); }; return (
{ editorRef.current = view; }} readOnly={true} theme={theme.includes('dark') ? 'dark' : 'light'} />
); }; export default SystemLog;