1 import { Component } from 'inferno';
2 import { Link } from 'inferno-router';
3 import { Post } from '../interfaces';
4 import { PostListing } from './post-listing';
6 interface PostListingsProps {
8 showCommunity?: boolean;
11 export class PostListings extends Component<PostListingsProps, any> {
13 constructor(props: any, context: any) {
14 super(props, context);
20 {this.props.posts.length > 0 ? this.props.posts.map(post =>
21 <PostListing post={post} showCommunity={this.props.showCommunity} />) :
22 <div>No Listings. {!this.props.showCommunity && <span>Subscribe to some <Link to="/communities">forums</Link>.</span>}