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) =>