metadata-based-explorer1
Version:
Box UI Elements
19 lines (15 loc) • 455 B
JavaScript
import * as React from 'react';
import { ContentState } from 'draft-js';
var DraftMentionItem = function DraftMentionItem(_ref) {
var contentState = _ref.contentState,
entityKey = _ref.entityKey,
children = _ref.children;
var id = '';
if (entityKey) {
id = contentState.getEntity(entityKey).getData().id;
}
return React.createElement("a", {
href: "/profile/".concat(id)
}, children);
};
export default DraftMentionItem;