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