Renders a comment of a dump's thread and, recursively, its replies.
f
CommentNode(unnamed 0: CommentNodeProps): React.JSX.Element
Renders a comment with its like button, and the reply, edit and delete
actions for whoever may use them. Its author and moderators may edit and
delete it. A deleted comment shows as "[deleted]", with its replies. The
element's id, comment-<id>, is the anchor notifications link to.
I
CommentNodeProps
Passed to CommentNode by CommentThread for each top-level comment,
and by CommentNode for each reply. The callbacks are CommentThread's,
passed down unchanged.
- comment: Comment
- currentUser: SelfUser | null
-
depth: number
Sets the replies'
--depth: the deeper, the narrower their indent. - dumpId: string
- onCommentCreated: (comment: Comment) => void
- onCommentDeleted: (commentId: string) => void
- onCommentUpdated: (comment: Comment) => void
-
tree: Map<string, Comment[]>
The replies of every comment, by parent id, from
CommentThread.
Usage
import * as mod from "src/components/comment/CommentNode.tsx";