import { useField } from "@contember/binding";
import { memo } from "react";
import { jsxDEV } from "react/jsx-dev-runtime";
import { getDiscriminatedBlock } from "../../blocks/getDiscriminatedBlock.js";
import { RepeaterItem } from "../Repeater/RepeaterItem.js";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/BlockRepeater/SortableBlock.tsx";
const SortableBlock = memo((props) => {
  const field = useField(props.discriminationField);
  const selectedBlock = getDiscriminatedBlock(props.normalizedBlocks, field);
  if (!selectedBlock) {
    return null;
  }
  return /* @__PURE__ */ jsxDEV(RepeaterItem, {
    ...props,
    label: selectedBlock.datum.label,
    children: selectedBlock.datum.children
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 22,
    columnNumber: 3
  }, void 0);
});
SortableBlock.displayName = "SortableBlock";
export {
  SortableBlock
};
//# sourceMappingURL=SortableBlock.js.map
