import { jsxDEV } from "react/jsx-dev-runtime";
import { BindingError } from "@contember/react-binding";
import { DeleteEntityButton } from "@contember/react-binding-ui";
import { RepeaterItemContainer } from "@contember/ui";
import { memo, forwardRef } from "react";
const RepeaterItem = memo(forwardRef(({
  canBeRemoved,
  children,
  createNewEntity: _INTENTIONALLY_OMITTED_createNewEntity,
  dragHandleComponent,
  index,
  label,
  removalType,
  ...rest
}, forwardedRef) => {
  if (removalType !== "delete") {
    throw new BindingError(
      `As a temporary limitation, <Repeater /> can currently only delete its items, not disconnect them. This restriction is planned to be lifted sometime in future.`
    );
  }
  return /* @__PURE__ */ jsxDEV(
    RepeaterItemContainer,
    {
      ref: forwardedRef,
      dragHandleComponent,
      label,
      index,
      actions: canBeRemoved && /* @__PURE__ */ jsxDEV(DeleteEntityButton, {}, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx",
        lineNumber: 42,
        columnNumber: 29
      }, void 0),
      ...rest,
      children
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx",
      lineNumber: 37,
      columnNumber: 3
    },
    void 0
  );
}));
RepeaterItem.displayName = "RepeaterItem";
export {
  RepeaterItem
};
//# sourceMappingURL=RepeaterItem.js.map
