1 import { Component } from "inferno";
2 import { CommunityModeratorView, Language, PersonView } from "lemmy-js-client";
3 import { CommentNodeI, CommentViewType } from "../../interfaces";
4 import { CommentNode } from "./comment-node";
6 interface CommentNodesProps {
8 moderators?: CommunityModeratorView[];
10 maxCommentsShown?: number;
16 showContext?: boolean;
17 showCommunity?: boolean;
18 enableDownvotes?: boolean;
19 viewType: CommentViewType;
20 allLanguages: Language[];
21 siteLanguages: number[];
25 export class CommentNodes extends Component<CommentNodesProps, any> {
26 constructor(props: CommentNodesProps, context: any) {
27 super(props, context);
31 let maxComments = this.props.maxCommentsShown ?? this.props.nodes.length;
34 <div className="comments">
35 {this.props.nodes.slice(0, maxComments).map(node => (
37 key={node.comment_view.comment.id}
39 noBorder={this.props.noBorder}
40 noIndent={this.props.noIndent}
41 viewOnly={this.props.viewOnly}
42 locked={this.props.locked}
43 moderators={this.props.moderators}
44 admins={this.props.admins}
45 markable={this.props.markable}
46 showContext={this.props.showContext}
47 showCommunity={this.props.showCommunity}
48 enableDownvotes={this.props.enableDownvotes}
49 viewType={this.props.viewType}
50 allLanguages={this.props.allLanguages}
51 siteLanguages={this.props.siteLanguages}
52 hideImages={this.props.hideImages}