import { jsxDEV } from "react/jsx-dev-runtime";
import { AccessorErrors, EmptyMessage, CreateNewEntityButton } from "@contember/react-binding-ui";
import { FieldContainer } from "@contember/ui";
import { memo } from "react";
const RepeaterFieldContainer = memo(
  ({
    accessor,
    addButtonText,
    children,
    createNewEntity,
    addButtonComponent: AddButton = CreateNewEntityButton,
    addButtonComponentExtraProps,
    addButtonProps,
    emptyMessage,
    emptyMessageComponent,
    enableAddingNew = true,
    formatMessage,
    isEmpty,
    label,
    ...rest
  }) => {
    return /* @__PURE__ */ jsxDEV(
      FieldContainer,
      {
        label,
        ...rest,
        useLabelElement: false,
        footer: enableAddingNew && /* @__PURE__ */ 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__ */ jsxDEV(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__ */ jsxDEV(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";
export {
  RepeaterFieldContainer
};
//# sourceMappingURL=RepeaterFieldContainer.js.map
