import { Option } from "@sniptt/monads"; import { Component } from "inferno"; import { CommentNode as CommentNodeI, CommunityModeratorView, Language, PersonViewSafe, } from "lemmy-js-client"; import { CommentViewType } from "../../interfaces"; import { CommentNode } from "./comment-node"; interface CommentNodesProps { nodes: CommentNodeI[]; moderators: Option; admins: Option; maxCommentsShown: Option; noBorder?: boolean; noIndent?: boolean; viewOnly?: boolean; locked?: boolean; markable?: boolean; showContext?: boolean; showCommunity?: boolean; enableDownvotes?: boolean; viewType: CommentViewType; allLanguages: Language[]; hideImages?: boolean; } export class CommentNodes extends Component { constructor(props: any, context: any) { super(props, context); } render() { let maxComments = this.props.maxCommentsShown.unwrapOr( this.props.nodes.length ); return (
{this.props.nodes.slice(0, maxComments).map(node => ( ))}
); } }