"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const react = require("react");
const reactI18n = require("@contember/react-i18n");
const AddNewBlockButtonInner = require("./AddNewBlockButtonInner.cjs");
const Dictionary = require("./Dictionary.cjs");
const AddNewBlockButton = react.memo((props) => {
  const formatter = reactI18n.useMessageFormatter(Dictionary.blockRepeaterDictionary);
  const buttonProps = react.useMemo(
    () => ({
      children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
        /* @__PURE__ */ jsxDevRuntime.jsxDEV(
          ui.Icon,
          {
            blueprintIcon: "add",
            style: {
              marginRight: "0.2em",
              position: "relative",
              top: "-0.071em"
            }
          },
          void 0,
          false,
          {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButton.tsx",
            lineNumber: 19,
            columnNumber: 6
          },
          void 0
        ),
        props.children ?? formatter("blockRepeater.addNewBlockButton.addBlock")
      ] }, void 0, true, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButton.tsx",
        lineNumber: 18,
        columnNumber: 5
      }, void 0),
      disabled: props.isMutating,
      distinction: "seamless",
      display: "block",
      justify: "start"
    }),
    [formatter, props.isMutating, props.children]
  );
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.FieldContainer, { label: void 0, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Dropdown, { buttonProps, alignment: "center", children: ({ requestClose, forceUpdate, update }) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(
    AddNewBlockButtonInner.AddNewBlockButtonInner,
    {
      normalizedBlocks: props.normalizedBlocks,
      createNewEntity: props.createNewEntity,
      isMutating: props.isMutating,
      discriminationField: props.discriminationField,
      requestClose,
      forceUpdate,
      update
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButton.tsx",
      lineNumber: 42,
      columnNumber: 6
    },
    void 0
  ) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButton.tsx",
    lineNumber: 40,
    columnNumber: 4
  }, void 0) }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/AddNewBlockButton.tsx",
    lineNumber: 39,
    columnNumber: 3
  }, void 0);
});
AddNewBlockButton.displayName = "AddNewBlockButton";
exports.AddNewBlockButton = AddNewBlockButton;
//# sourceMappingURL=AddNewBlockButton.cjs.map
