import { BindingError } from "@contember/binding";
import { RepeaterItemContainer } from "@contember/ui";
import { memo } from "react";
import { jsxDEV } from "react/jsx-dev-runtime";
import { DeleteEntityButton } from "../helpers/DeleteEntityButton.js";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx";
const RepeaterItem = memo(({
  children,
  canBeRemoved,
  label,
  removalType,
  dragHandleComponent
}) => {
  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, {
    dragHandleComponent,
    label,
    actions: canBeRemoved ? /* @__PURE__ */ jsxDEV(DeleteEntityButton, {}, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 29
    }, void 0) : void 0,
    children
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 26,
    columnNumber: 4
  }, void 0);
});
RepeaterItem.displayName = "RepeaterItem";
export {
  RepeaterItem
};
//# sourceMappingURL=RepeaterItem.js.map
