"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var react_apollo_1 = require("react-apollo");
var graphql_tag_1 = __importDefault(require("graphql-tag"));
var UniswapBuy_1 = require("../buy/UniswapBuy");
var TokensTextComponents_1 = require("../TokensTextComponents");
var ethPriceQuery = graphql_tag_1.default(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  query {\n    storefrontEthPrice\n  }\n"], ["\n  query {\n    storefrontEthPrice\n  }\n"])));
exports.UniswapBuySection = function (props) {
    return (React.createElement("div", null,
        React.createElement(TokensTextComponents_1.TokenAirswapExchangeText, null),
        React.createElement(react_apollo_1.Query, { query: ethPriceQuery }, function (_a) {
            var loading = _a.loading, error = _a.error, data = _a.data;
            if (loading) {
                return React.createElement("div", null);
            }
            return (React.createElement(React.Fragment, null,
                React.createElement("div", null,
                    React.createElement(UniswapBuy_1.UniswapBuy, { usdToSpend: props.usdToSpend, ethToSpend: props.ethToSpend, ethExchangeRate: data.storefrontEthPrice, onBuyComplete: props.onBuyComplete }))));
        })));
};
var templateObject_1;
//# sourceMappingURL=UniswapBuySection.js.map