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;
};
import React, { useState } from 'react';
export var AmountInput = function (_a) {
    var amount = _a.amount, selectedCurrency = _a.selectedCurrency, setCurrency = _a.setCurrency, onChange = _a.onChange;
    var _b = __read(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.createElement("div", { className: "amount-input-wrapper" },
        React.createElement("input", { value: amount, type: "number", className: "amount-input", onChange: function (event) { return onChange(event.target.value); } }),
        React.createElement("div", { className: "amount-dropdown" },
            React.createElement("button", { className: "amount-dropdown-btn " + (disabled ? '' : 'amount-dropdown-toggle') + " " + (expanded ? 'expanded' : ''), onClick: function () { return disabled || setExpanded(!expanded); } }, selectedCurrency),
            expanded &&
                React.createElement("ul", { className: "amount-dropdown-list" }, currenciesList
                    .filter(function (currency) { return currency !== selectedCurrency; })
                    .map(function (currency) { return (React.createElement("li", { key: currency },
                    React.createElement("button", { onClick: function () { return onCurrencyItemClick(currency); }, className: "amount-dropdown-btn" }, currency))); })))));
};
//# sourceMappingURL=AmountInput.js.map