import { jsx as n, jsxs as m } from "react/jsx-runtime";
import { forwardRef as d } from "react";
import { c as f } from "./index.Bxix3KXR.js";
import { _ as l } from "./twind.BLUk_ZzT.js";
import { b as p } from "./use-section-style.Cg6VYj5D.js";
import { a as u } from "./iconify.Bxbp05s7.js";
const y = d(({ brick: o, editable: e }, i) => {
  const s = p(o), { props: t } = o, r = Object.values(s), a = (k) => {
    if (e) {
      f("This button is not clickable in edit mode", {
        id: "button-no-click-toast",
        style: {
          minWidth: "max-content"
        }
      });
      return;
    }
    t.linkToUrlOrPageId && (t.linkToUrlOrPageId.startsWith("http") ? window.open(t.linkToUrlOrPageId, "_blank") : console.log(`Navigate to page ID: ${t.linkToUrlOrPageId}`));
  }, c = t.icon ? /* @__PURE__ */ n(u, { icon: t.icon, className: "w-5 h-5" }) : null;
  return /* @__PURE__ */ n("div", { className: l("flex flex-1"), children: /* @__PURE__ */ m(
    "button",
    {
      type: "button",
      className: l(r, "flex-1 w-full"),
      "data-prevented-by-editor": e ? "true" : "false",
      ref: i,
      onClick: a,
      children: [
        c,
        t.label
      ]
    }
  ) });
});
export {
  y as default
};
//# sourceMappingURL=button.DfSW0V_z.js.map
