mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
29 lines
No EOL
671 B
JavaScript
29 lines
No EOL
671 B
JavaScript
const PostList = props => {
|
|
|
|
({PostItem, LoadMore, PostsLoading, NoPosts, NoMorePosts, PostViews} = Telescope.components);
|
|
|
|
if (!!props.results.length) {
|
|
return (
|
|
<div className="postList">
|
|
<PostViews />
|
|
{props.results.map(post => <PostItem {...post} key={post._id}/>)}
|
|
{props.hasMore ? (props.ready ? <LoadMore {...props}/> : <PostsLoading/>) : <NoMorePosts/>}
|
|
</div>
|
|
)
|
|
} else if (!props.ready) {
|
|
return (
|
|
<div className="postList">
|
|
<PostsLoading/>
|
|
</div>
|
|
)
|
|
} else {
|
|
return (
|
|
<div className="postList">
|
|
<NoPosts/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = PostList; |