+ {/* Post Content Box */}
+
+
+ {/* Title and Profile Section */}
+
+
+
{post.title}
+ {post.writer.id === user?.id && (
+
+
+ {showOptions && (
+
+
+
+
+
+
+ )}
+
+ )}
+
+
+
+
+ {authorImageError ? ( // Updated author image rendering
+
+
+ {post.writer.nickname.charAt(0).toUpperCase()}
+
+
+ ) : (
+
setAuthorImageError(true)}
+ />
+ )}
+ {post.writer.nickname}
+ |
+
+ {formatDate(post.createdAt)}
+
+
+
+
+
+ {post.commentCount}
+
+
+
+ {post.likeCount}
+
+
+
+
+ {/* Content Section */}
+
+ {post.content}
+
+
+
+
+ {/* Comment Section */}
+
+
댓글({post.commentCount})
+
+
+ {/* Comment Input Box */}
+
+
+ setNewComment(e.target.value)}
+ size="w-full h-[132px] sm:h-[132px] lg:h-[160px]"
+ />
+
+
+
+
+
+
+
+ {/* Comments List or Empty State */}
+
+ {comments.length > 0 ? (
+
+ {comments.map((comment, index) => (
+
+
+ ))}
+ {isLoading &&
로딩 중...
}
+
+ ) : (
+
+ = 1024 ? "md" : "sm"}.svg`}
+ alt="No comments"
+ width={window.innerWidth >= 1024 ? 206 : 206}
+ height={window.innerWidth >= 1024 ? 204 : 152}
+ />
+
+ )}
+
+ {showEditModal && (
+
setShowEditModal(false)}
+ onUpdate={(updatedPost) => {
+ setInitialPost(updatedPost);
+ setShowEditModal(false);
+ }}
+ />
+ )}
+