"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var utils_1 = require("@joincivil/utils");
var styleConstants_1 = require("../styleConstants");
var Button_1 = require("../Button");
var icons_1 = require("../icons");
var StyledEthAddressViewer_1 = require("./StyledEthAddressViewer");
exports.EthAddressViewer = function (props) {
    var address = props.address, displayName = props.displayName, etherscanBaseURL = props.etherscanBaseURL;
    var etherscanURL = etherscanBaseURL && etherscanBaseURL + "/address/" + address.replace(/ /g, "");
    return (React.createElement(StyledEthAddressViewer_1.StyledEthAddressViewer, null,
        React.createElement(StyledEthAddressViewer_1.StyledDisplayName, null, displayName),
        React.createElement(StyledEthAddressViewer_1.StyledEthAddressContainer, null,
            React.createElement(StyledEthAddressViewer_1.StyledEthAddress, null, props.address),
            React.createElement(Button_1.Button, { size: Button_1.buttonSizes.SMALL, onClick: function () { return utils_1.copyToClipboard(address.replace(/ /g, "")); } }, "Copy"),
            !!etherscanURL && (React.createElement(Button_1.InvertedButton, { size: Button_1.buttonSizes.SMALL, href: etherscanURL, target: "_blank" },
                "Etherscan ",
                React.createElement(icons_1.NorthEastArrow, { color: styleConstants_1.colors.accent.CIVIL_BLUE }))))));
};
//# sourceMappingURL=EthAddressViewer.js.map