-
{item.username}
+
{nickName}
-
{item.content}
- {item.images && item.images.length > 0 && (
+
{content}
+ {images && images.length > 0 && (
- {item.images.map((image, index) => (
+ {images.map((image, index) => (

{
)}
-
查看图片
+ {images && images.length > 0 && (
+
查看图片
+ )}
-
{item.time}
+
{time}
}
- onClick={() => handleLike(item.id)}
+ onClick={() => handleLike(item.snsId)}
className={styles.actionButton}
- />
+ >
+ {likesCount > 0 && {likesCount}}
+
}
- onClick={() => handleComment(item.id)}
+ onClick={() => handleComment(item.snsId)}
className={styles.actionButton}
- />
+ >
+ {commentsCount > 0 && {commentsCount}}
+
+
+ {/* 点赞和评论区域 */}
+ {(item.likeList.length > 0 || item.commentList.length > 0) && (
+
+ {/* 点赞列表 */}
+ {item.likeList.length > 0 && (
+
+
+
+ {item.likeList.map((like, index) => (
+
+ {like.nickName}
+ {index < item.likeList.length - 1 && "、"}
+
+ ))}
+
+
+ )}
+
+ {/* 评论列表 */}
+ {item.commentList.length > 0 && (
+
+ {item.commentList.map(comment => (
+
+
+ {comment.nickName}
+
+ :
+
+ {comment.content}
+
+
+ ))}
+
+ )}
+
+ )}