]> Untitled Git - lemmy.git/blob - ui/src/components/post-listings.tsx
Merge branch 'dev'
[lemmy.git] / ui / src / components / post-listings.tsx
1 import { Component } from 'inferno';
2 import { Link } from 'inferno-router';
3 import { Post } from '../interfaces';
4 import { PostListing } from './post-listing';
5
6 interface PostListingsProps {
7   posts: Array<Post>;
8   showCommunity?: boolean;
9 }
10
11 export class PostListings extends Component<PostListingsProps, any> {
12
13   constructor(props: any, context: any) {
14     super(props, context);
15   }
16
17   render() {
18     return (
19       <div>
20         {this.props.posts.length > 0 ? this.props.posts.map(post => 
21           <PostListing post={post} showCommunity={this.props.showCommunity} />) : 
22           <div>No posts. {this.props.showCommunity !== undefined  && <span>Subscribe to some <Link to="/communities">communities</Link>.</span>}
23         </div>
24         }
25       </div>
26     )
27   }
28 }