import React from 'react'; import ReactDOM from 'react-dom'; import { connect } from 'react-redux'; import { clickRelative } from '../../actions/app-actions'; class NodeDetailsTableNodeLink extends React.Component { constructor(props, context) { super(props, context); this.handleClick = this.handleClick.bind(this); } handleClick(ev) { ev.preventDefault(); this.props.dispatch(clickRelative(this.props.nodeId, this.props.topologyId, this.props.label, ReactDOM.findDOMNode(this).getBoundingClientRect())); } render() { if (this.props.linkable) { return ( {this.props.label} ); } return ( {this.props.label} ); } } export default connect()(NodeDetailsTableNodeLink);