comments: refactor to use ViewComponent.

This commit is contained in:
evazion
2021-01-14 19:26:31 -06:00
parent d408ccbd41
commit 724d87f68a
9 changed files with 129 additions and 106 deletions

View File

@@ -0,0 +1,10 @@
module CommentsHelper
def render_comment(comment, **options)
render CommentComponent.new(comment: comment, **options)
end
def render_comment_list(comments, **options)
dtext_data = DText.preprocess(comments.map(&:body))
render CommentComponent.with_collection(comments, dtext_data: dtext_data, **options)
end
end