Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / src / components / EditorForwardingGraph / mapConnectionPoint.js
diff --git a/skyquake/plugins/composer/src/src/components/EditorForwardingGraph/mapConnectionPoint.js b/skyquake/plugins/composer/src/src/components/EditorForwardingGraph/mapConnectionPoint.js
new file mode 100644 (file)
index 0000000..354f5f2
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * Created by onvelocity on 3/4/16.
+ */
+'use strict'
+import React from 'react'
+import onCutDelegateToRemove from './onCutDelegateToRemove'
+import onHoverHighlightConnectionPoint from './onHoverHighlightConnectionPoint'
+import onClickSelectAndShowInDetailsPanel from './onClickSelectAndShowInDetailsPanel'
+export default function mapConnectionPoint(style, addLine, cpRef, i) {
+       return (
+               <div key={cpRef.uid || i} className="rsp">
+                       {addLine ? <div className="rsp-line"></div> : null}
+                       <div className={cpRef.className} data-uid={cpRef.uid} style={style}
+                                onCut={onCutDelegateToRemove.bind(null, cpRef)}
+                                onMouseEnter={onHoverHighlightConnectionPoint.bind(null, cpRef.cpNumber)}
+                                onMouseLeave={onHoverHighlightConnectionPoint.bind(null, cpRef.cpNumber)}
+                                onClick={onClickSelectAndShowInDetailsPanel.bind(null, cpRef)}>
+                               <small>{cpRef.cpNumber || cpRef.vnfdConnectionPointName}</small>
+                       </div>
+               </div>
+       );
+}