import React from 'react'; import Comment from './Comment'; import TextEntryField from './TextEntryField'; /** * Renders a list of comment bodies, followed by a 'reply' field. */ const CommentWidget = props => { const commentBodies = props.annotation ? props.annotation.bodies.filter(b => // No purpose or 'commenting', 'replying' !b.hasOwnProperty('purpose') || b.purpose === 'commenting' || b.purpose === 'replying' ) : []; return ( <> { commentBodies.map((body, idx) => )} { !props.readOnly && props.annotation &&
0 ? 'Add a reply...' : 'Add a comment...'} onChange={props.onUpdateReply} onOk={() => props.onOk()} />
} ) } export default CommentWidget;