@@ -74,7 +74,7 @@ const MindMapComponent = ({
7474
7575 const meetingStart = ( ) => {
7676 const client = new Client ( {
77- brokerURL : "wss ://3.39.11.168:8080/ws" , // 서버 WebSocket URL q
77+ brokerURL : "ws ://3.39.11.168:8080/ws" , // 서버 WebSocket URL q
7878 reconnectDelay : 5000 ,
7979 debug : ( str ) => {
8080 console . log ( str ) ;
@@ -138,7 +138,7 @@ const MindMapComponent = ({
138138 projectId : conferenceData . projectId ,
139139 scription : testString ,
140140 } ;
141- postScript ( data ) . then ( ( res : any ) => {
141+ postScript ( conferenceData . projectId , data ) . then ( ( res : any ) => {
142142 setScriptList ( [ ] ) ;
143143
144144 setSummary ( ( prev ) => [
@@ -243,8 +243,6 @@ const MindMapComponent = ({
243243 useEffect ( ( ) => {
244244 setNodes ( initialNodes ) ;
245245 setEdges ( initialEdges ) ;
246-
247- console . log ( initialNodes , initialEdges ) ;
248246 } , [ initialNodes , initialEdges ] ) ; // 임시방편으로 만듦
249247
250248 const onConnect = useCallback (
@@ -280,6 +278,20 @@ const MindMapComponent = ({
280278 [ nodes , edges ]
281279 ) ;
282280
281+ const ClickKeyword = ( keyword : string ) => {
282+ const newNode : Node = {
283+ id : `${ Date . now ( ) } ` ,
284+ type : "default" ,
285+ data : { label : keyword } ,
286+ position : {
287+ x : Math . random ( ) * 250 ,
288+ y : Math . random ( ) * 250 ,
289+ } ,
290+ } ;
291+
292+ setNodes ( ( nds ) => [ ...nds , newNode ] ) ;
293+ } ;
294+
283295 return (
284296 < div className = "mind-map-container" >
285297 { mode === "none" ? (
@@ -409,6 +421,7 @@ const MindMapComponent = ({
409421 className = "keyword"
410422 id = { x . id . toString ( ) }
411423 key = { x . id }
424+ onClick = { ( ) => { ClickKeyword ( x . value ) } }
412425 >
413426 { x . value }
414427 </ button >
@@ -427,6 +440,7 @@ const MindMapComponent = ({
427440 className = "keyword"
428441 id = { x . id . toString ( ) }
429442 key = { x . id }
443+ onClick = { ( ) => { ClickKeyword ( x . value ) } }
430444 >
431445 { x . value }
432446 </ button >
0 commit comments