2016-02-16 16:12:13 +09:00
|
|
|
const CommentList = props => {
|
|
|
|
|
2016-02-18 17:53:04 +09:00
|
|
|
({LoadMore, PostsLoading, NoPosts, NoMorePosts, CommentNode} = Telescope.components);
|
|
|
|
|
2016-02-16 16:12:13 +09:00
|
|
|
if (!!props.results.length) {
|
|
|
|
return (
|
|
|
|
<div className="commentList">
|
2016-02-18 21:39:33 +09:00
|
|
|
{props.results.map(comment => <CommentNode comment={comment} key={comment._id} currentUser={props.currentUser}/>)}
|
2016-02-16 16:12:13 +09:00
|
|
|
{props.hasMore ? (props.ready ? <LoadMore {...props}/> : <PostsLoading/>) : <NoMorePosts/>}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
} else if (!props.ready) {
|
|
|
|
return (
|
|
|
|
<div className="commentList">
|
|
|
|
<PostsLoading/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
return (
|
|
|
|
<div className="commentList">
|
|
|
|
<NoPosts/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = CommentList;
|