import React from "react";
import { uuid } from "./../../wix-rich-content-common/index.js";
class ToolbarButton {
  constructor(toolbarItem, toolbarItemRender) {
    this.toolbarItem = toolbarItem;
    this.toolbarItemRenderElement = toolbarItemRender;
    this.key = uuid();
  }
  getId() {
    return this.toolbarItem.id;
  }
  getButtonElement() {
    return React.cloneElement(this.toolbarItemRenderElement, {
      key: this.key
    });
  }
  getButtonElementWithDataHook() {
    const { dataHook = "" } = this.toolbarItem.presentation || {};
    return React.cloneElement(this.toolbarItemRenderElement, {
      key: this.key,
      dataHook
    });
  }
  getButtonDataHook() {
    const { dataHook = "" } = this.toolbarItem.presentation || {};
    return dataHook;
  }
}
export {
  ToolbarButton
};
//# sourceMappingURL=toolbar-button.js.map
