import { Edit } from "@wix/wix-ui-icons-common";
import React, { useContext } from "react";
import { RicosContext } from "./../../ricos-context/index.js";
import { ToolbarButton } from "./../../_shared/toolbar-button/toolbar-button.js";
const ImageEditorButton = ({ toolbarItem, dataHook }) => {
  const { t } = useContext(RicosContext) || {};
  const [referenceElement, setReferenceElement] = React.useState(null);
  return /* @__PURE__ */ React.createElement(
    ToolbarButton,
    {
      ref: setReferenceElement,
      prefix: Edit,
      onClick: () => toolbarItem.commands.click({ referenceElement }),
      dataHook,
      ariaLabel: t("ImageEditorButton_Tooltip"),
      tooltip: t("ImageEditorButton_Tooltip"),
      disabled: !toolbarItem.attributes?.selectedNode?.attrs.image?.src?.id,
      tabIndex: toolbarItem.presentation.tabIndex
    }
  );
};
export {
  ImageEditorButton
};
//# sourceMappingURL=image-editor-button.js.map
