mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-01 18:20:00 +00:00
28 lines
773 B
TypeScript
28 lines
773 B
TypeScript
import { Component } from 'inferno';
|
|
import { Link } from 'inferno-router';
|
|
import { Post } from '../interfaces';
|
|
import { PostListing } from './post-listing';
|
|
|
|
interface PostListingsProps {
|
|
posts: Array<Post>;
|
|
showCommunity?: boolean;
|
|
}
|
|
|
|
export class PostListings extends Component<PostListingsProps, any> {
|
|
|
|
constructor(props: any, context: any) {
|
|
super(props, context);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
{this.props.posts.length > 0 ? this.props.posts.map(post =>
|
|
<PostListing post={post} showCommunity={this.props.showCommunity} />) :
|
|
<div>No posts. {this.props.showCommunity !== undefined && <span>Subscribe to some <Link to="/communities">communities</Link>.</span>}
|
|
</div>
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
}
|