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