"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 CurrencyConverter_1 = require("../CurrencyConverter");
function round(amount) {
    return amount ? Math.round(amount * 1000) / 1000 : 0;
}
exports.TokenPurchaseSummary = function (props) {
    var mode = props.mode, currencyCode = props.currencyCode, totalPrice = props.totalPrice, totalTokens = props.totalTokens, pricePer = props.pricePer;
    return (React.createElement(CurrencyConverter_1.CurrencyCalcCVL, null,
        React.createElement("span", null,
            "You are ",
            mode === "buy" ? "buying" : "selling"),
        React.createElement("h4", null,
            round(totalTokens),
            " ",
            currencyCode),
        totalTokens > 0 ? (React.createElement("p", null,
            "approx. $",
            round(totalPrice),
            " @ $",
            round(pricePer),
            " per ",
            currencyCode)) : null));
};
//# sourceMappingURL=TokenPurchaseSummary.js.map