"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 PaymentsFormWrapper_1 = require("./PaymentsFormWrapper");
var PaymentsTextComponents_1 = require("./PaymentsTextComponents");
var PaymentsStyledComponents_1 = require("./PaymentsStyledComponents");
var PaymentsModal_1 = require("./PaymentsModal");
var MODEL_CONTENT;
(function (MODEL_CONTENT) {
    MODEL_CONTENT[MODEL_CONTENT["WHY_ETH"] = 0] = "WHY_ETH";
    MODEL_CONTENT[MODEL_CONTENT["WHAT_IS_ETH"] = 1] = "WHAT_IS_ETH";
    MODEL_CONTENT[MODEL_CONTENT["CAN_USE_CVL"] = 2] = "CAN_USE_CVL";
})(MODEL_CONTENT = exports.MODEL_CONTENT || (exports.MODEL_CONTENT = {}));
var PaymentsEthWrapper = /** @class */ (function (_super) {
    __extends(PaymentsEthWrapper, _super);
    function PaymentsEthWrapper(props) {
        var _this = _super.call(this, props) || this;
        _this.renderInfoModal = function () {
            switch (_this.state.modalContent) {
                case MODEL_CONTENT.WHY_ETH:
                    return React.createElement(PaymentsTextComponents_1.WhyEthInfoText, null);
                case MODEL_CONTENT.WHAT_IS_ETH:
                    return React.createElement(PaymentsTextComponents_1.WhatIsEthInfoText, null);
                case MODEL_CONTENT.CAN_USE_CVL:
                    return React.createElement(PaymentsTextComponents_1.CanUseCVLInfoText, null);
                default:
                    return React.createElement(React.Fragment, null);
            }
        };
        _this.openInfoModal = function (modelContent) {
            _this.setState({ isInfoModalOpen: true, modalContent: modelContent });
        };
        _this.handleClose = function () {
            _this.setState({ isInfoModalOpen: false });
        };
        _this.state = {
            isInfoModalOpen: false,
        };
        return _this;
    }
    PaymentsEthWrapper.prototype.render = function () {
        var _this = this;
        return (React.createElement(PaymentsFormWrapper_1.PaymentsFormWrapper, { handleEditPaymentType: this.props.handleEditPaymentType, payWithText: React.createElement(PaymentsTextComponents_1.PayWithEthText, null), paymentNoticeText: React.createElement(PaymentsTextComponents_1.PaymentEthNoticeText, null) },
            React.createElement(PaymentsStyledComponents_1.PaymentEthLearnMore, null,
                React.createElement("a", { onClick: function () { return _this.openInfoModal(MODEL_CONTENT.WHAT_IS_ETH); } }, "What is ETH?"),
                React.createElement("a", { onClick: function () { return _this.openInfoModal(MODEL_CONTENT.WHY_ETH); } }, "Why ETH?"),
                React.createElement("a", { onClick: function () { return _this.openInfoModal(MODEL_CONTENT.CAN_USE_CVL); } }, "Can I use CVL?")),
            React.createElement(PaymentsStyledComponents_1.PaymentAmountEth, null,
                React.createElement("label", null, "Boost"),
                this.props.etherToSpend + " ETH",
                " ",
                React.createElement("span", null,
                    "\u2248 ",
                    "$" + this.props.usdToSpend)),
            this.props.children,
            React.createElement(PaymentsModal_1.PaymentsModal, { open: this.state.isInfoModalOpen, handleClose: this.handleClose }, this.renderInfoModal())));
    };
    return PaymentsEthWrapper;
}(React.Component));
exports.PaymentsEthWrapper = PaymentsEthWrapper;
//# sourceMappingURL=PaymentsEthWrapper.js.map