From 14b2809aed9a77a9bf7051703da21c816a199215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Sun, 8 Mar 2026 18:50:09 +0300 Subject: [PATCH] feat(comments-pane): refactor comments display logic for improved asset and comment pane management --- components/video-page/comments-pane.tsx | 62 ++++++++++++++----------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/components/video-page/comments-pane.tsx b/components/video-page/comments-pane.tsx index b9e5982..1e41de2 100644 --- a/components/video-page/comments-pane.tsx +++ b/components/video-page/comments-pane.tsx @@ -276,30 +276,35 @@ export const CommentsPane = memo(function CommentsPane({ )} -
- {activePane === 'assets' ? assetsPane : filteredComments.length === 0 ? ( -
- -

No comments yet

-

Be the first to leave feedback!

-
- ) : ( - sortedComments.map((comment) => { - const authorName = - comment.author?.name || comment.guestName || 'Anonymous'; - const isEditing = editingCommentId === comment.id; - const isReplying = replyingTo === comment.id; - const canEditComment = comment.canEdit ?? (comment.author?.id === currentUserId); - const canDeleteComment = comment.canDelete ?? (comment.author?.id === currentUserId || projectOwnerId === currentUserId); - const canManageComment = canEditComment || canDeleteComment; - return ( -
+
+
+ {assetsPane} +
+ +
+ {filteredComments.length === 0 ? ( +
+ +

No comments yet

+

Be the first to leave feedback!

+
+ ) : ( + sortedComments.map((comment) => { + const authorName = + comment.author?.name || comment.guestName || 'Anonymous'; + const isEditing = editingCommentId === comment.id; + const isReplying = replyingTo === comment.id; + const canEditComment = comment.canEdit ?? (comment.author?.id === currentUserId); + const canDeleteComment = comment.canDelete ?? (comment.author?.id === currentUserId || projectOwnerId === currentUserId); + const canManageComment = canEditComment || canDeleteComment; + return ( +
@@ -884,10 +889,11 @@ export const CommentsPane = memo(function CommentsPane({ Reply )} -
- ); - }) - )} +
+ ); + }) + )} +
{activePane === 'comments' ? composer : null}