import { memo, createElement } from "react";
import { BindingError } from "@contember/binding";
import { RepeaterItemContainer } from "@contember/ui";
import { DeleteEntityButton } from "../helpers/DeleteEntityButton.js";
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__ */ createElement(RepeaterItemContainer, {
    dragHandleComponent,
    label,
    actions: canBeRemoved ? /* @__PURE__ */ createElement(DeleteEntityButton, null) : void 0
  }, children);
});
RepeaterItem.displayName = "RepeaterItem";
export { RepeaterItem };
//# sourceMappingURL=RepeaterItem.js.map
