11import React from 'react' ;
2+ // import CustomNode from '../styles/CustomNode';
23// will create a build func and then call the helper funcs to return an object
34// make a new instance of this class in flow, call the build method, and pass this as state
5+ // const nodeTypes = {
6+ // custom: CustomNode,
7+ // };
8+
49class FlowBuilder {
510 constructor ( data ) {
611 this . parsedData = [ data ] ;
@@ -19,31 +24,26 @@ class FlowBuilder {
1924 id : ( ++ this . id ) . toString ( ) ,
2025 data : {
2126 label : (
22- < div key = { this . id } >
23- < ul >
24- < li > { item . fileName } </ li >
25- < li > Client Component: { item . isClientComponent . toString ( ) } </ li >
26- </ ul >
27+ < div className = { `-mx-2.5 -my-2.5 py-2 px-9 shadow-lg rounded-md border-2 border-gray-500 ${ ( item . isClientComponent ) ? 'bg-orange-300' : 'bg-blue-300' } ` } >
28+ < div className = "flex justify-center place-items-center" key = { this . id } >
29+ < div className = "text-base font-medium" > { item . fileName } </ div >
30+ </ div >
2731 </ div >
2832 )
2933 } ,
30- type : item . depth === 0 ? 'input' : '' ,
34+ // type: item.depth === 0 ? 'input' : '',
35+ type : 'default' ,
3136 position : { x : 0 , y : 0 } ,
3237 style : {
33- backgroundColor : "var(--vscode-dropdown-background)" ,
34- borderRadius : "15px" ,
35- width : '265px' ,
36- boxShadow : '0px 4px 4px rgba(0, 0, 0, 0.25)' ,
3738 border : 'none' ,
38- padding : '10px 10px 3px 10px'
39- } ,
39+ borderRadius : "6px"
40+ }
4041 } ;
4142 this . initialNodes . push ( node ) ;
4243 if ( item . children ) {
4344 this . buildNodesArray ( item . children ) ;
4445 }
4546 } ) ;
46- // console.log('initialNodes', this.initialNodes);
4747 } ;
4848
4949 buildEdgesArray ( parsedData , parentID ) {
@@ -65,7 +65,6 @@ class FlowBuilder {
6565 this . buildEdgesArray ( item . children , nodeID ) ;
6666 }
6767 } ) ;
68- // console.log('initialEdges', this.initialEdges);
6968 }
7069
7170 build ( settings ) {
0 commit comments