"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Markets", {
    enumerable: true,
    get: function() {
        return Markets;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _text = require("../../../../../text");
const _icon = require("../../../../../icon");
const _lucidereact = require("lucide-react");
const _dropdown = require("../../../../../dropdown/dropdown");
const _myMarkets = require("./myMarkets");
const Markets = ({ symbol })=>{
    const [open, setOpen] = (0, _react.useState)(false);
    // const [allMarkets] = useMarkets(MarketsType.ALL);
    // const curSymbol = useMemo(() => {
    //   const index = allMarkets.findIndex((item) => item.symbol === symbol);
    //   if (index === -1) {
    //     return {
    //       symbol: symbol,
    //       favorite: false,
    //     };
    //   }
    //   return {
    //     symbol: symbol,
    //     // @ ts-ignore
    //     favorite: allMarkets[index].isFavorite || false,
    //   }
    // }, [allMarkets, symbol]);
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdown.DropdownMenu, {
        open: open,
        onOpenChange: setOpen,
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdown.DropdownMenuTrigger, {
                asChild: true,
                children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("button", {
                    className: "orderly-px-2 orderly-flex orderly-items-center orderly-gap-1 orderly-h-full",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_icon.NetworkImage, {
                            type: "symbol",
                            symbol: symbol,
                            size: "small"
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_text.Text, {
                            rule: "symbol",
                            className: "orderly-text-xs orderly-break-normal orderly-whitespace-nowrap orderly-font-semibold",
                            children: symbol
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_lucidereact.ChevronDown, {
                            size: 14
                        })
                    ]
                })
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdown.DropdownMenuContent, {
                onCloseAutoFocus: (e)=>e.preventDefault(),
                align: "start",
                className: "orderly-ui-markets-dropdown-menu-content orderly-w-[580px] orderly-p-0 orderly-bg-base-900 orderly-rounded-borderRadius orderly-shadow-[0px_12px_20px_0px_rgba(0,0,0,0.25)]",
                children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_myMarkets.MemoizedMarkets, {
                    onClose: ()=>setOpen(false)
                })
            })
        ]
    });
};

//# sourceMappingURL=markets.js.map