From e2387beaa3631694ef42042dc1ac20f949b4c560 Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Sat, 5 Apr 2025 19:10:21 +0100 Subject: [PATCH] Update comments component --- components/ui/Comments.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/components/ui/Comments.tsx b/components/ui/Comments.tsx index 249889a..a71bc75 100644 --- a/components/ui/Comments.tsx +++ b/components/ui/Comments.tsx @@ -52,13 +52,10 @@ Comments.ReplyButton = function ReplyButton({comment}: ReplyButton) { ) } -Comments.Comment = function Comment({comment, children, isReply = false}: { +Comments.Comment = function Comment({comment, isReply = false}: { comment: Comment, - children?: ReactNode, isReply?: boolean }) { - const {data: session} = useSession() - return ( <>
- {children} ) } @@ -96,11 +92,14 @@ Comments.List = function List({comments}: CommentsListProps) { Comments {comments.map((comment) => ( - - {comment.replies && comment.replies.map(reply => ( - - ))} - + + + {(typeof comment.replies !== 'undefined' && comment.replies.length > 0) ? + comment.replies.map(reply => ( + + )) : null + } + ))} }