import { jsxDEV } from "react/jsx-dev-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__ */ jsxDEV(
      RepeaterItemContainer,
      {
        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: 31,
          columnNumber: 29
        }, globalThis) : void 0,
        children
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/Repeater/RepeaterItem.tsx",
        lineNumber: 27,
        columnNumber: 4
      },
      globalThis
    );
  }
);
RepeaterItem.displayName = "RepeaterItem";
export {
  RepeaterItem
};
//# sourceMappingURL=RepeaterItem.js.map
