import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import React from "react";
import { Section, Row } from "../grid";
import Tabs from "../tabs";
import InputToken from "../input-token";
import Select from "../select";
import Button from "../button";
import Space from "../space";
import { t } from "ttag";
import { Wrapper } from "./styled";
import TextBase from "../text";
const LendBorrow = ({ lang }) => {
    const [method, setMethod] = React.useState("lend");
    const formMethods = React.useMemo(() => {
        return [
            {
                value: "lend",
                label: _jsx(TextBase.T2, { children: t `Lend` }),
            },
            {
                value: "borrow",
                label: _jsx(TextBase.T2, { children: t `Borrow` }),
            },
        ];
    }, [lang]);
    const [amount, setAmount] = React.useState("");
    const [token, setToken] = React.useState("Btc");
    const [chain, setChain] = React.useState("BTC");
    return (_jsx(Section, { isCard: true, className: "ui-lend-borrow", children: _jsxs(Wrapper, { children: [_jsx(Tabs, { items: formMethods, onChange: (v) => setMethod(v) }), _jsx(Space, { height: 9 }), _jsxs(Row, { children: [_jsx(InputToken, { amount: amount, token: token, onChange: (amount, token) => {
                                setAmount(amount);
                                setToken(token);
                            } }), _jsx(Space, { width: 24 }), _jsx(Select, { onSelect: (selected) => {
                                setChain(selected);
                            }, title: t `From chain`, width: "210px", theme: {
                                titleLineHeight: "20px",
                            }, children: _jsx(Select.Option, { children: t `BTC chain` }, "BTC") }), _jsx(Space, { width: 19 }), _jsxs("div", { children: [_jsx(Space, { height: 28 }), _jsx(Button, { className: "ui-lend-borrow__button", children: t `Lend` })] })] }), method === "borrow" && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 15 }), _jsx(Select, { width: "600px", title: `to address` })] }))] }) }));
};
export default LendBorrow;
//# sourceMappingURL=index.js.map