import React, { useContext } from "react";
import { RicosContext } from "./../../../ricos-context/index.js";
import { DropdownModal } from "./../../../_shared/dropdown-modal/dropdown-modal.js";
import { ListItemSelect } from "./../../../_shared/list-item-select/list-item-select.js";
import { INSERT_PANEL_OPTIONS } from "./consts.js";
const InsertDropdown = ({ onClick, closeModal, category }) => {
  const { t, isMobile } = useContext(RicosContext);
  const options = INSERT_PANEL_OPTIONS[category] || [];
  return /* @__PURE__ */ React.createElement(
    DropdownModal,
    {
      options: options.map((option) => /* @__PURE__ */ React.createElement(
        ListItemSelect,
        {
          key: option.key,
          dataHook: option.dataHook,
          title: t(option.title),
          prefix: isMobile ? /* @__PURE__ */ React.createElement(option.icon, null) : /* @__PURE__ */ React.createElement(option.iconSmall, null),
          onSelect: () => {
            onClick({
              commandKey: option.commandKey
            });
            closeModal();
          }
        }
      )),
      onCloseButtonClick: closeModal,
      title: t("TablePlugin_Toolbar_ContextMenu_Header_Title")
    }
  );
};
export {
  InsertDropdown
};
//# sourceMappingURL=insert-dropdown.js.map
