'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const jsxRuntime = require('react/jsx-runtime');
const tooltip = require('../../tooltip.cjs');
const toggle = require('../../toggle.cjs');
const utils = require('../../../lib/utils.cjs');

const ToolbarButton = ({
  isActive,
  children,
  tooltip: tooltip$1,
  className,
  tooltipOptions,
  ...props
}) => {
  const toggleButton = /* @__PURE__ */ jsxRuntime.jsx(toggle.Toggle, { className: utils.cn({ "bg-accent": isActive }, className), ...props, children });
  if (!tooltip$1) {
    return toggleButton;
  }
  return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
    /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: toggleButton }),
    /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { ...tooltipOptions, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center text-center", children: tooltip$1 }) })
  ] });
};
ToolbarButton.displayName = "ToolbarButton";

exports.ToolbarButton = ToolbarButton;
exports.default = ToolbarButton;
