11import React , { useEffect , useMemo , useState } from 'react' ;
22import Editor from '@monaco-editor/react' ;
3- import { FaPlay } from 'react-icons/fa' ;
3+ import { FaPlay , FaCrown , FaPenFancy , FaEye , FaChartBar } from 'react-icons/fa' ;
44import './CodeEditor.css' ;
55
66/**
@@ -19,16 +19,17 @@ export default function CodeEditor({ file, readOnly = false, onChange, currentUs
1919 const language = useMemo ( ( ) => file ?. language || 'python' , [ file ?. language ] ) ;
2020
2121 const handleRun = ( ) => alert ( '코드 실행 기능은 아직 미구현입니다.' ) ;
22+ const handleVisualize = ( ) => alert ( '코드 시각화 기능은 아직 미구현입니다.' ) ;
2223
2324 const roleIcon = ( role ) => {
24- if ( role === 'host' ) return '👑' ;
25- if ( role === 'edit' ) return '✏️' ;
26- if ( role === 'view' ) return '👁️' ;
25+ if ( role === 'host' ) return < FaCrown className = "role-icon host" /> ;
26+ if ( role === 'edit' ) return < FaPenFancy className = "role-icon edit" /> ;
27+ if ( role === 'view' ) return < FaEye className = "role-icon view" /> ;
2728 return '' ;
2829 } ;
2930
30- // const theme = document.body.classList.contains('dark-mode') ? 'vs-light' : 'vs-dark';
3131 const theme = isDark ? 'vs-dark' : 'vs-light' ; // ✅ props 우선
32+
3233 return (
3334 < section className = "code-editor" >
3435 < div className = "editor-header" >
@@ -39,9 +40,18 @@ export default function CodeEditor({ file, readOnly = false, onChange, currentUs
3940 </ div >
4041 ) }
4142
42- < button className = "run-button" onClick = { handleRun } >
43+ { /* <button className="run-button" onClick={handleRun}>
4344 <FaPlay /> 실행
44- </ button >
45+ </button>*/ }
46+ { /* ✅ 오른쪽 툴바: 실행 + 시각화 */ }
47+ < div className = "toolbar-right" >
48+ < button className = "run-button" onClick = { handleRun } >
49+ < FaPlay /> 실행
50+ </ button >
51+ < button className = "viz-button" onClick = { handleVisualize } >
52+ < FaChartBar /> 시각화
53+ </ button >
54+ </ div >
4555 </ div >
4656
4757 { /* 필요 시 height=100%로 바꿔도 됩니다 (부모 컨테이너가 flex:1이면) */ }
0 commit comments