{"size": 702, "ext": "js", "max_stars_repo_path": "src/modules/etherscan/EtherscanLink.js", "max_stars_repo_name": "jmul-dev/ao-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/modules/etherscan/EtherscanLink.js", "max_issues_repo_name": "jmul-dev/ao-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/modules/etherscan/EtherscanLink.js", "max_forks_repo_name": "jmul-dev/ao-frontend", "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": 31.9090909091, "max_line_length": 263, "alphanum_fraction": 0.6310541311}
import React from 'react';
import { connect } from 'react-redux';

/**
 * EtherscanLink
 * 
 * @param {type} 'tx' | 'address'
 */
const EtherscanLink = ({type, value, ethNetworkLink, children, style = {}, ...props}) => (
    <a href={`${ethNetworkLink}/${type}/${value}`} target="_blank" style={{whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: '100%', display: 'inline-block', verticalAlign: 'middle', color: 'rgba(0, 204, 71, 1)', ...style}} {...props}>
        {children ? children : value}
    </a>
)

const mapStateToProps = (store) => {
    return {
        ethNetworkLink: store.app.ethNetworkLink
    }
}


export default connect(mapStateToProps, {})(EtherscanLink)