"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const reactBinding = require("@contember/react-binding");
const react = require("react");
const getDiscriminatedBlock = require("../../blocks/getDiscriminatedBlock.cjs");
const RepeaterItem = require("../Repeater/RepeaterItem.cjs");
const SortableBlock = react.memo(({
  discriminationField,
  normalizedBlocks,
  ...props
}) => {
  const field = reactBinding.useField(discriminationField);
  const selectedBlock = getDiscriminatedBlock.getDiscriminatedBlock(normalizedBlocks, field);
  if (!selectedBlock) {
    return null;
  }
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(RepeaterItem.RepeaterItem, { ...props, label: selectedBlock.datum.label, children: selectedBlock.datum.children }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx",
    lineNumber: 29,
    columnNumber: 3
  }, void 0);
});
SortableBlock.displayName = "SortableBlock";
exports.SortableBlock = SortableBlock;
//# sourceMappingURL=SortableBlock.cjs.map
