import { Statistics } from "@wix/wix-ui-icons-common";
import { Node_Type } from "./../ricos-types/index.js";
import { INSERT_PLUGIN_BUTTONS, TOOLBARS } from "./../editor-common/index.js";
import { InsertModal } from "./components/insert-modal/insert-modal.js";
import { INSERT_POLL_MODAL_ID } from "./consts.js";
import { INSERT_POLL_BUTTON } from "./data-hooks.js";
const toolbarsToAddIn = [
  TOOLBARS.FOOTER,
  TOOLBARS.SIDE,
  TOOLBARS.MOBILE
];
const getAddButtons = (config, services) => {
  const {
    modals,
    context: { isMobile }
  } = services;
  return [
    {
      id: Node_Type.POLL,
      label: INSERT_PLUGIN_BUTTONS.POLLS,
      dataHook: INSERT_POLL_BUTTON,
      icon: Statistics,
      tooltip: "Poll_InsertPoll_Tooltip",
      toolbars: [TOOLBARS.MOBILE, TOOLBARS.FOOTER, TOOLBARS.SIDE],
      command: ({ referenceElement }) => {
        modals?.togglePluginPanel({
          id: INSERT_POLL_MODAL_ID,
          Component: InsertModal,
          componentProps: {
            config
          },
          isMobile,
          positioning: {
            referenceElement,
            placement: "bottom"
          },
          mobileLayout: "drawer"
        });
        return true;
      },
      menuConfig: {
        tags: "Poll_plugin_search_tags"
      }
    }
  ];
};
export {
  getAddButtons,
  toolbarsToAddIn
};
//# sourceMappingURL=get-add-buttons.js.map
