import { jsxDEV } from "react/jsx-dev-runtime";
import { useField } from "@contember/react-binding";
import { memo } from "react";
import { getDiscriminatedBlock } from "../../blocks/getDiscriminatedBlock.js";
import { RepeaterItem } from "../Repeater/RepeaterItem.js";
const SortableBlock = memo(({
  discriminationField,
  normalizedBlocks,
  ...props
}) => {
  const field = useField(discriminationField);
  const selectedBlock = getDiscriminatedBlock(normalizedBlocks, field);
  if (!selectedBlock) {
    return null;
  }
  return /* @__PURE__ */ jsxDEV(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";
export {
  SortableBlock
};
//# sourceMappingURL=SortableBlock.js.map
