File size: 505 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import CommentIndexItem from './comment_index_item';

class CommentIndex extends React.Component {
  render() {
    if (!this.props.comments) return null;

    const commentsIndex = this.props.comments.map(comment => {
      return <CommentIndexItem
        key={comment.id}
        comment={comment}
        author={this.props.users[comment.authorId]}
      />
    });
    
    return (
      <div>
        {commentsIndex}
      </div>
    )
  }
}

export default CommentIndex;