@@ -2,6 +2,23 @@ import React from 'react';
22import styles from './GraphInspector.module.css' ;
33import { getIconForNodeType } from './ContextMenu' ;
44
5+ const PortItem = ( { port, isDarkTheme } ) => (
6+ < div className = { `${ styles . portContainer } ${ isDarkTheme ? styles . portContainerDark : styles . portContainerLight } ` } >
7+ < div className = { port . type === 'control' ? styles . portIconControl : styles . portIconData } />
8+ < div className = { styles . portInfo } >
9+ < div className = { styles . portNameRow } >
10+ < span > "{ port . name } "</ span >
11+ < span className = { styles . portType } > ({ port . type } )</ span >
12+ </ div >
13+ { port . description && (
14+ < div className = { `${ styles . portDescription } ${ isDarkTheme ? styles . portDescriptionDark : styles . portDescriptionLight } ` } >
15+ { port . description }
16+ </ div >
17+ ) }
18+ </ div >
19+ </ div >
20+ ) ;
21+
522const GraphInspector = ( {
623 selectedNodes,
724 nodeTypes,
@@ -95,11 +112,7 @@ const GraphInspector = ({
95112 Input Ports
96113 </ div >
97114 { nodeType . inputs . map ( ( input , index ) => (
98- < div key = { index } className = { `${ styles . portContainer } ${ config . isDarkTheme ? styles . portContainerDark : styles . portContainerLight } ` } >
99- < div className = { input . type === 'control' ? styles . portIconControl : styles . portIconData } />
100- < span > "{ input . name } "</ span >
101- < span className = { styles . portType } > ({ input . type } )</ span >
102- </ div >
115+ < PortItem key = { index } port = { input } isDarkTheme = { config . isDarkTheme } />
103116 ) ) }
104117
105118 { /* Output Ports */ }
@@ -108,11 +121,7 @@ const GraphInspector = ({
108121 Output Ports
109122 </ div >
110123 { nodeType . outputs . map ( ( output , index ) => (
111- < div key = { index } className = { `${ styles . portContainer } ${ config . isDarkTheme ? styles . portContainerDark : styles . portContainerLight } ` } >
112- < div className = { output . type === 'control' ? styles . portIconControl : styles . portIconData } />
113- < span > "{ output . name } "</ span >
114- < span className = { styles . portType } > ({ output . type } )</ span >
115- </ div >
124+ < PortItem key = { index } port = { output } isDarkTheme = { config . isDarkTheme } />
116125 ) ) }
117126 </ div >
118127 </ div >
0 commit comments