import { Component } from 'inferno'; import { Link } from 'inferno-router'; import { Post } from '../interfaces'; import { PostListing } from './post-listing'; import { i18n } from '../i18next'; interface PostListingsProps { posts: Array; showCommunity?: boolean; } export class PostListings extends Component { constructor(props: any, context: any) { super(props, context); } render() { return (
{this.props.posts.length > 0 ? ( this.props.posts.map(post => ( <>
)) ) : ( <>
{i18n.t('no_posts')}
{this.props.showCommunity !== undefined && (
{i18n.t('subscribe_to_communities')}
)} )}
); } }