import React, { useState } from "react";
import { List, SimpleListItem } from "@rmwc/list";
import { MenuSurface, MenuSurfaceAnchor } from "@rmwc/menu";
import * as S from "./styled";
export const ChartDropdown = ({ attributes, chartID, chartMetadata, dropdownMenu, }) => {
    const [isOpen, setIsOpen] = useState(false);
    const handleClose = () => {
        setIsOpen(false);
    };
    return (React.createElement(React.Fragment, null,
        React.createElement(S.DotsBtn, { name: "dots_2x3", onClick: () => {
                setIsOpen(true);
            } }),
        React.createElement(MenuSurfaceAnchor, null,
            React.createElement(MenuSurface, { open: isOpen, onClose: handleClose },
                React.createElement(List, null, dropdownMenu.map(({ icon, label, onClick }) => (React.createElement(SimpleListItem, { key: label, text: (React.createElement(S.DropdownItem, null,
                        icon,
                        React.createElement(S.DropdownItemLabel, null, label))), onClick: () => {
                        onClick({ attributes, chartMetadata, chartID });
                        handleClose();
                    } }))))))));
};
//# sourceMappingURL=chart-dropdown.js.map