gab-social/app/javascript/gabsocial/components/comment_list.js
2020-04-07 21:06:59 -04:00

30 lines
676 B
JavaScript

import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import Comment from './comment'
export default class CommentList extends ImmutablePureComponent {
static propTypes = {
descendants: ImmutablePropTypes.list,
}
render() {
const { descendants } = this.props
return (
<div>
{
descendants.map((descendant, i) => (
<Comment
key={`comment-${descendant.get('statusId')}-${i}`}
id={descendant.get('statusId')}
indent={descendant.get('indent')}
/>
))
}
</div>
)
}
}