+
+
+
{post.username}
+
+ {new Date(post.createdAt).toLocaleDateString()}{' '}
+ {new Date(post.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
+
+
+
{post.content}
+
+
+ ❤️ {post.likesCount} Likes
+ 💬 {post.commentsCount} Comments
+
+
+
+
+
Comments
+
+
+
+ {loading &&
Loading comments...
}
+
+ {error && (
+
+ Error loading comments: {error}
+
+ )}
+
+ {!loading && !error && (
+
setComments(comments.filter((c) => c.id !== id))}
+ />
+ )}
+
+
+ {showCreateComment && (
+
setShowCreateComment(false)}
+ onCommentCreated={handleCommentCreated}
+ />
+ )}
+