"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
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_1 = __importStar(require("react"));
exports.AmountInput = function (_a) {
    var amount = _a.amount, selectedCurrency = _a.selectedCurrency, setCurrency = _a.setCurrency, onChange = _a.onChange;
    var _b = __read(react_1.useState(false), 2), expanded = _b[0], setExpanded = _b[1];
    var currenciesList = ['ETH'];
    var disabled = currenciesList.length < 2;
    var onCurrencyItemClick = function (currency) {
        setExpanded(false);
        setCurrency(currency);
    };
    return (react_1.default.createElement("div", { className: "amount-input-wrapper" },
        react_1.default.createElement("input", { value: amount, type: "number", className: "amount-input", onChange: function (event) { return onChange(event.target.value); } }),
        react_1.default.createElement("div", { className: "amount-dropdown" },
            react_1.default.createElement("button", { className: "amount-dropdown-btn " + (disabled ? '' : 'amount-dropdown-toggle') + " " + (expanded ? 'expanded' : ''), onClick: function () { return disabled || setExpanded(!expanded); } }, selectedCurrency),
            expanded &&
                react_1.default.createElement("ul", { className: "amount-dropdown-list" }, currenciesList
                    .filter(function (currency) { return currency !== selectedCurrency; })
                    .map(function (currency) { return (react_1.default.createElement("li", { key: currency },
                    react_1.default.createElement("button", { onClick: function () { return onCurrencyItemClick(currency); }, className: "amount-dropdown-btn" }, currency))); })))));
};
//# sourceMappingURL=AmountInput.js.map