"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBindingUi = require("@contember/react-binding-ui");
const ui = require("@contember/ui");
const react = require("react");
const RepeaterFieldContainer = react.memo(
  ({
    accessor,
    addButtonText,
    children,
    createNewEntity,
    addButtonComponent: AddButton = reactBindingUi.CreateNewEntityButton,
    addButtonComponentExtraProps,
    addButtonProps,
    emptyMessage,
    emptyMessageComponent,
    enableAddingNew = true,
    formatMessage,
    isEmpty,
    label,
    ...rest
  }) => {
    return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
      ui.FieldContainer,
      {
        label,
        ...rest,
        useLabelElement: false,
        footer: enableAddingNew && /* @__PURE__ */ jsxDevRuntime.jsxDEV(
          AddButton,
          {
            ...addButtonComponentExtraProps,
            ...addButtonProps,
            createNewEntity,
            children: addButtonText ?? label ?? formatMessage("repeater.addButton.text")
          },
          void 0,
          false,
          {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx",
            lineNumber: 58,
            columnNumber: 6
          },
          void 0
        ),
        children: [
          /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBindingUi.AccessorErrors, { accessor }, void 0, false, {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx",
            lineNumber: 67,
            columnNumber: 5
          }, void 0),
          isEmpty && /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBindingUi.EmptyMessage, { component: emptyMessageComponent, children: formatMessage(emptyMessage, "repeater.emptyMessage.text") }, void 0, false, {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx",
            lineNumber: 69,
            columnNumber: 6
          }, void 0),
          isEmpty || children
        ]
      },
      void 0,
      true,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterFieldContainer.tsx",
        lineNumber: 53,
        columnNumber: 4
      },
      void 0
    );
  }
);
RepeaterFieldContainer.displayName = "RepeaterFieldContainer";
exports.RepeaterFieldContainer = RepeaterFieldContainer;
//# sourceMappingURL=RepeaterFieldContainer.cjs.map
