"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const SelectInput_1 = __importDefault(require("../SelectInput"));
const TokenSelector = (props) => {
    const { tokenSelectorOptions, selectedPaymentToken, setSelectedPaymentToken } = props;
    console.log("tokenSelectorOptions: ", tokenSelectorOptions);
    const handleChange = (event) => {
        const selectedOption = tokenSelectorOptions === null || tokenSelectorOptions === void 0 ? void 0 : tokenSelectorOptions.find((option) => (option === null || option === void 0 ? void 0 : option.address) === event.target.value);
        setSelectedPaymentToken(selectedOption);
    };
    return (react_1.default.createElement("div", null,
        react_1.default.createElement(SelectInput_1.default, { options: tokenSelectorOptions, label: "Token Selector:", onChange: handleChange, optionLabelKey: "tokenName", optionValueKey: "address" })));
};
exports.default = TokenSelector;
//# sourceMappingURL=TokenSelector.js.map