From 320eed551e918ac927c770809807095691eb9b0e Mon Sep 17 00:00:00 2001 From: ngthanhvu Date: Fri, 24 Jul 2026 03:39:06 -0400 Subject: [PATCH] feat: enhance comment section with reply functionality and pinning feature - Added ability to pin comments for admin users. - Implemented nested replies with a recursive component for better organization. - Improved comment loading with time-ago formatting for replies. - Refactored comment fetching logic to include replies in a structured format. - Updated UI to reflect changes in comment state (pinned, anonymous). - Added loading indicators for comment submission and reply actions. - Enhanced error handling for comment operations. --- app/components/CommentReplies.vue | 143 +++++++++++ app/components/CommentSection.vue | 391 +++++++++++++++++++++--------- server/api/comments/index.get.ts | 85 ++++--- server/api/comments/index.post.ts | 52 ++-- 4 files changed, 501 insertions(+), 170 deletions(-) create mode 100644 app/components/CommentReplies.vue diff --git a/app/components/CommentReplies.vue b/app/components/CommentReplies.vue new file mode 100644 index 0000000..79d024c --- /dev/null +++ b/app/components/CommentReplies.vue @@ -0,0 +1,143 @@ + + +