import { useEffect } from 'react';
import license from '../scripts/synapeditor/license.json';
import SynapEditor from '../editorsscripts/synapeditor/synapeditor.min';
import '../editorsscripts/synapeditor/synapeditor.min.css';
function SynapEditorComponent({ editorId }) {
useEffect(() => {
console.log();
const config = {
'editor.license': { },
'editor.size.width': '800px', license // 라이센스를 설정합니다.
// 기타 설정을 추가합니다. 필요에 따라 prop을 통해 값을 받아서 설정할 수 있도록 처리합니다.
};
'editor.size.height': '500px' const html = ''; // 에디터 초기화시 };표시할 html을 설정합니다. 필요에 따라 prop을 통해 값을 받아서 const설정할 html수 = '';있도록 처리합니다.
const eventListener = {
initialized: (event) => {
// 에디터가 초기화 되었을 때 실행되는 이벤트 리스너입니다.
// 에디터가 초기화 되면 수행되어야 하는 작업을 작성합니다.
console.log('에디터 초기화 완료: ', event);
}
};
new SynapEditor(editorId, config, html, eventListener);
}, [editorId]);
return (
<div id={editorId}></div>
);
}
export default SynapEditorComponent; |