mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
28 lines
No EOL
707 B
JavaScript
28 lines
No EOL
707 B
JavaScript
const CommentList = props => {
|
|
|
|
({LoadMore, PostsLoading, NoPosts, NoMorePosts, CommentNode} = Telescope.components);
|
|
|
|
if (!!props.results.length) {
|
|
return (
|
|
<div className="commentList">
|
|
{props.results.map(comment => <CommentNode comment={comment} key={comment._id} currentUser={props.currentUser}/>)}
|
|
{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; |