]> Untitled Git - lemmy-ui.git/blob - src/shared/components/comment/comment-nodes.tsx
Fixing nav-link
[lemmy-ui.git] / src / shared / components / comment / comment-nodes.tsx
1 import { Component } from "inferno";
2 import { CommunityModeratorView, PersonViewSafe } from "lemmy-js-client";
3 import { CommentNode as CommentNodeI } from "../../interfaces";
4 import { CommentNode } from "./comment-node";
5
6 interface CommentNodesProps {
7   nodes: CommentNodeI[];
8   moderators?: CommunityModeratorView[];
9   admins?: PersonViewSafe[];
10   postCreatorId?: number;
11   noBorder?: boolean;
12   noIndent?: boolean;
13   viewOnly?: boolean;
14   locked?: boolean;
15   markable?: boolean;
16   showContext?: boolean;
17   showCommunity?: boolean;
18   enableDownvotes: boolean;
19 }
20
21 export class CommentNodes extends Component<CommentNodesProps, any> {
22   constructor(props: any, context: any) {
23     super(props, context);
24   }
25
26   render() {
27     return (
28       <div className="comments">
29         {this.props.nodes.map(node => (
30           <CommentNode
31             key={node.comment_view.comment.id}
32             node={node}
33             noBorder={this.props.noBorder}
34             noIndent={this.props.noIndent}
35             viewOnly={this.props.viewOnly}
36             locked={this.props.locked}
37             moderators={this.props.moderators}
38             admins={this.props.admins}
39             postCreatorId={this.props.postCreatorId}
40             markable={this.props.markable}
41             showContext={this.props.showContext}
42             showCommunity={this.props.showCommunity}
43             enableDownvotes={this.props.enableDownvotes}
44           />
45         ))}
46       </div>
47     );
48   }
49 }