+
setIsMobileCommentsOpen(!isMobileCommentsOpen)}
+ >
Comments
{comments.length}
-
+
+
+
+
@@ -2202,496 +2213,496 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi
) : (
sortedComments.map((comment) => {
- const authorName =
- comment.author?.name || comment.guestName || 'Anonymous';
- const isEditing = editingCommentId === comment.id;
- const isReplying = replyingTo === comment.id;
- return (
-
-
-
-
-
-
- {authorName.charAt(0)}
-
-
-
{authorName}
-
+ const authorName =
+ comment.author?.name || comment.guestName || 'Anonymous';
+ const isEditing = editingCommentId === comment.id;
+ const isReplying = replyingTo === comment.id;
+ return (
+
+
+
+
+
+
+ {authorName.charAt(0)}
+
+
+
{authorName}
+
-
-
-
+
+ {isEditing ? (
+
+ ) : (
+ comment.content &&
{comment.content}
+ )}
- {isEditing ? (
-
- ) : (
- comment.content &&
{comment.content}
- )}
-
- {comment.voiceUrl && (
-
-
playVoice(comment.id, comment.voiceUrl!, comment.voiceDuration || 0)}
- >
- {playingVoiceId === comment.id ? (
-
- ) : (
-
- )}
-
-
-
- {playingVoiceId === comment.id
- ? `${formatTime(voiceCurrentTime)} / ${formatTime(comment.voiceDuration || 0)}`
- : formatTime(comment.voiceDuration || 0)}
-
- {playingVoiceId === comment.id && (
-
- {voicePlaybackRate}x
-
+ {comment.voiceUrl && (
+
+
playVoice(comment.id, comment.voiceUrl!, comment.voiceDuration || 0)}
+ >
+ {playingVoiceId === comment.id ? (
+
+ ) : (
+
)}
+
+
- )}
-
-
-
- {new Date(comment.createdAt).toLocaleDateString()}
-
- {comment.tag && (
-
+ {playingVoiceId === comment.id
+ ? `${formatTime(voiceCurrentTime)} / ${formatTime(comment.voiceDuration || 0)}`
+ : formatTime(comment.voiceDuration || 0)}
+
+ {playingVoiceId === comment.id && (
+
- {comment.tag.name}
-
+ {voicePlaybackRate}x
+
)}
+ )}
- {comment.replies && comment.replies.length > 0 && (
-
- {comment.replies.map((reply) => {
- const replyAuthor =
- reply.author?.name || reply.guestName || 'Anonymous';
- const isEditingReply = editingCommentId === reply.id;
- return (
-
-
-
-
-
- {replyAuthor.charAt(0)}
-
-
-
{replyAuthor}
-
- {new Date(reply.createdAt).toLocaleDateString()}
-
-
- {(reply.author?.id === currentUserId || video.project.ownerId === currentUserId) && (
-
-
-
-
-
-
-
- {reply.author?.id === currentUserId && (
- {
- setEditingCommentId(reply.id);
- setEditText(reply.content || '');
- }}>
-
- Edit
-
- )}
- handleDeleteComment(reply.id)}
- >
-
- Delete
-
-
-
- )}
+
+
+ {new Date(comment.createdAt).toLocaleDateString()}
+
+ {comment.tag && (
+
+ {comment.tag.name}
+
+ )}
+
+
+ {comment.replies && comment.replies.length > 0 && (
+
+ {comment.replies.map((reply) => {
+ const replyAuthor =
+ reply.author?.name || reply.guestName || 'Anonymous';
+ const isEditingReply = editingCommentId === reply.id;
+ return (
+
+
+
+
+
+ {replyAuthor.charAt(0)}
+
+
+
{replyAuthor}
+
+ {new Date(reply.createdAt).toLocaleDateString()}
+
- {isEditingReply ? (
-
- ) : (
- reply.content &&
{reply.content}
- )}
- {reply.voiceUrl && (
-
-
playVoice(reply.id, reply.voiceUrl!, reply.voiceDuration || 0)}
- >
- {playingVoiceId === reply.id ? (
-
- ) : (
-
+
+
+ {reply.author?.id === currentUserId && (
+ {
+ setEditingCommentId(reply.id);
+ setEditText(reply.content || '');
+ }}>
+
+ Edit
+
)}
-
-
-
- {playingVoiceId === reply.id
- ? `${formatTime(voiceCurrentTime)} / ${formatTime(reply.voiceDuration || 0)}`
- : formatTime(reply.voiceDuration || 0)}
-
- {playingVoiceId === reply.id && (
-
handleDeleteComment(reply.id)}
>
- {voicePlaybackRate}x
-
- )}
-
+
+ Delete
+
+
+
)}
- );
- })}
-
- )}
+ {isEditingReply ? (
+
+ ) : (
+ reply.content &&
{reply.content}
+ )}
+ {reply.voiceUrl && (
+
+
playVoice(reply.id, reply.voiceUrl!, reply.voiceDuration || 0)}
+ >
+ {playingVoiceId === reply.id ? (
+
+ ) : (
+
+ )}
+
+
+
+ {playingVoiceId === reply.id
+ ? `${formatTime(voiceCurrentTime)} / ${formatTime(reply.voiceDuration || 0)}`
+ : formatTime(reply.voiceDuration || 0)}
+
+ {playingVoiceId === reply.id && (
+
+ {voicePlaybackRate}x
+
+ )}
+
+ )}
+
+ );
+ })}
+
+ )}
- {isReplying && (
-
- {isReplyRecording ? (
-
-
-
- {formatTime(replyRecordingTime)}
-
-
-
- Stop
+ {isReplying && (
+
+ {isReplyRecording ? (
+
+
+
+ {formatTime(replyRecordingTime)}
+
+
+
+ Stop
+
+
+
+
+
+ ) : replyAudioBlob ? (
+
+
+
{
+ const url = URL.createObjectURL(replyAudioBlob);
+ playVoice('reply-preview', url, replyRecordingTime);
+ }}
+ >
+ {playingVoiceId === 'reply-preview' ? : }
-
+
+
+ {playingVoiceId === 'reply-preview'
+ ? `${formatTime(voiceCurrentTime)} / ${formatTime(replyRecordingTime)}`
+ : formatTime(replyRecordingTime)}
+
+ {playingVoiceId === 'reply-preview' && (
+
+ {voicePlaybackRate}x
+
+ )}
+
- ) : replyAudioBlob ? (
-
-
-
{
- const url = URL.createObjectURL(replyAudioBlob);
- playVoice('reply-preview', url, replyRecordingTime);
- }}
- >
- {playingVoiceId === 'reply-preview' ? : }
-
-
-
- {playingVoiceId === 'reply-preview'
- ? `${formatTime(voiceCurrentTime)} / ${formatTime(replyRecordingTime)}`
- : formatTime(replyRecordingTime)}
-
- {playingVoiceId === 'reply-preview' && (
-
- {voicePlaybackRate}x
-
- )}
-
-
-
-
+
+ ) : (
+ <>
+
- ) : (
- <>
-
-
-
- handleReplyComment(comment.id)}
- disabled={!replyText.trim() || isSubmittingReply}
- className="h-7 text-xs"
- >
- {isSubmittingReply ? : 'Reply'}
-
- { setReplyingTo(null); setReplyText(''); }}
- className="h-7 text-xs"
- >
- Cancel
-
-
- >
- )}
-
- )}
+
+ handleReplyComment(comment.id)}
+ disabled={!replyText.trim() || isSubmittingReply}
+ className="h-7 text-xs"
+ >
+ {isSubmittingReply ? : 'Reply'}
+
+ { setReplyingTo(null); setReplyText(''); }}
+ className="h-7 text-xs"
+ >
+ Cancel
+
+
+ >
+ )}
+
+ )}
- {!isReplying && !isEditing && (
- { setReplyingTo(comment.id); setReplyText(''); }}
- className="mt-2 text-xs text-muted-foreground hover:text-foreground flex items-center gap-1"
- >
-
- Reply
-
- )}
-
- );
- })
+ {!isReplying && !isEditing && (
+
{ setReplyingTo(comment.id); setReplyText(''); }}
+ className="mt-2 text-xs text-muted-foreground hover:text-foreground flex items-center gap-1"
+ >
+
+ Reply
+
+ )}
+
+ );
+ })
)}