import React, { useContext } from "react";
import { RicosContext } from "./../../../../ricos-context/index.js";
import { ToolbarButton } from "./../../../../_shared/toolbar-button/toolbar-button.js";
const ToggleButton = ({ toolbarItem, onClick, dataHook }) => {
  const { t } = useContext(RicosContext);
  const tooltip = toolbarItem.presentation?.tooltip;
  return /* @__PURE__ */ React.createElement(
    ToolbarButton,
    {
      active: toolbarItem.attributes.active,
      disabled: toolbarItem.attributes.disabled,
      tooltip: t(tooltip),
      onClick,
      prefix: toolbarItem.presentation?.icon,
      dataHook: `${dataHook} ${toolbarItem.attributes.active ? "active" : "disabled"}`,
      tabIndex: toolbarItem.presentation.tabIndex
    }
  );
};
export {
  ToggleButton
};
//# sourceMappingURL=toggle-button.js.map
