import React from "react"; import { EditorContext, TargetContext } from "../public/context"; export function DraftEntity(props) { const context = React.useContext(EditorContext); const { contentState, entityKey } = props; const entity = contentState.getEntity(entityKey); const { name, data } = entity.getData(); const Comp = context.entitys[name]; if (context.readOnly) { return ; } const isIMMu = entity.getMutability() === "IMMUTABLE"; if (isIMMu) { return ; } return ; } function EntityWithIsSelected(props) { const target = React.useContext(TargetContext); const { blockKey, start, end } = props.props; let isSelected = target.hasFocus && target.key === blockKey && target.offset >= start && target.offset < end; return ; } const EntityRender = React.memo(function (props: any) { let { context, data, Comp } = props.props; return ; });