{"size": 1597, "ext": "js", "max_stars_repo_path": "src/integrations/corda/renderer/components/NodeLink.js", "max_stars_repo_name": "PinkDiamond1/ganache-ui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/integrations/corda/renderer/components/NodeLink.js", "max_issues_repo_name": "PinkDiamond1/ganache-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/integrations/corda/renderer/components/NodeLink.js", "max_forks_repo_name": "PinkDiamond1/ganache-ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.0238095238, "max_line_length": 137, "alphanum_fraction": 0.5754539762}
import { Link } from "react-router-dom";
import React, { PureComponent } from "react";

class NodeLink extends PureComponent {
  render() {
    const type = this.props.type === "notary" ? "notaries" : "nodes";
    const node = this.props.node;
    const services = this.props.services || [];
    return (
      <Link to={`/corda/${type}/${node.safeName}`} className="DataRow corda-node-link">
        <div className="corda-link-left">
          <div className="corda-node-name-description">
            <div className="Label">Legal ID</div>
            <div className="Value">{node.name}</div>
          </div>
          <div className="corda-node-port-description">
            <div className="Label">RPC Port</div>
            <div className="Value">{node.rpcPort}</div>
          </div>
          <div className="corda-node-port-description">
            <div className="Label">P2P Port</div>
            <div className="Value">{node.p2pPort}</div>
          </div>
          <div className="corda-node-port-description">
            <div className="Label">Admin Port</div>
            <div className="Value">{node.adminPort}</div>
          </div>
          <div className="corda-node-port-description">
            <div className="Label">SSHD Port</div>
            <div className="Value">{node.sshdPort}</div>
          </div>
        </div>
        <div className="corda-link-right">
          {services.map((service) => <div className="TransactionTypeBadge ContractCallBadge" key={`service-${service}`}>{service}</div>)}
        </div>
      </Link>
    );
  }
}

export default NodeLink;
