import { jsx as l } from "react/jsx-runtime";
import { L as a } from "./chunk-RXIM6GTA.C-ABNABt.js";
import "@sinclair/typebox";
import { _ as f } from "./twind.D_WBdNpx.js";
import { b as m } from "./use-section-style.CgktT_qE.js";
import { B as c } from "./BrickRoot.LoA8SzjD.js";
function x({ brick: o, editable: e }) {
  const r = m(o), { props: t } = o, n = Object.values(r), s = (i) => {
    if (e) {
      i.preventDefault();
      return;
    }
    t.linkToUrlOrPageId && (t.linkToUrlOrPageId.startsWith("http") ? window.open(t.linkToUrlOrPageId, "_blank") : console.log(`Navigate to page ID: ${t.linkToUrlOrPageId}`));
  };
  return /* @__PURE__ */ l(
    c,
    {
      manifest: a,
      editable: e,
      as: "button",
      type: "button",
      className: f(
        n,
        t.color,
        t.size,
        "font-medium min-h-fit max-h-fit flex items-center text-center justify-center flex-wrap",
        e && "pointer-events-none"
      ),
      "data-prevented-by-editor": e ? "true" : "false",
      onClick: s,
      children: t.label
    }
  );
}
export {
  x as default
};
//# sourceMappingURL=button.DWUQzJ0q.js.map
