@@ -49,6 +49,8 @@ const CommentSection = ({ comments, postId, refresh }: CommentSectionProps) => {
4949 } ) ;
5050 } ;
5151
52+ console . log ( "comments" , comments ) ;
53+
5254 return (
5355 < div className = "min-h-[50vh] pb-[49px]" >
5456 { comments ?. map ( ( comment ) => (
@@ -92,6 +94,8 @@ const Comment = ({
9294 setActiveDropdown ( activeDropdown === commentId ? null : commentId ) ;
9395 } ;
9496
97+ const isDeleted = comment . content === "" ;
98+
9599 return (
96100 < div
97101 className = { clsx (
@@ -126,7 +130,12 @@ const Comment = ({
126130 ) }
127131 < div className = "flex w-full flex-col" >
128132 < div className = "flex justify-between" >
129- < CommentProfile user = { comment . postFindSiteUserResponse } />
133+ < CommentProfile
134+ user = { {
135+ ...comment . postFindSiteUserResponse ,
136+ nickname : isDeleted ? "알 수 없음" : comment . postFindSiteUserResponse . nickname ,
137+ } }
138+ />
130139 { comment . isOwner && (
131140 < CommentDropdown
132141 commentId = { comment . id }
@@ -136,7 +145,9 @@ const Comment = ({
136145 />
137146 ) }
138147 </ div >
139- < div className = "mt-3 text-sm font-normal leading-normal text-black" > { comment . content } </ div >
148+ < div className = "mt-3 text-sm font-normal leading-normal text-black" >
149+ { isDeleted ? "삭제된 댓글입니다" : comment . content }
150+ </ div >
140151 < div className = "mt-2 overflow-hidden text-xs font-normal leading-normal text-[#7c7c7c]" >
141152 { convertISODateToDateTime ( comment . createdAt ) || "1970. 01. 01. 00:00" }
142153 </ div >
@@ -152,14 +163,14 @@ const CommentProfile = ({ user }: { user: CommunityUser }) => {
152163 < Image
153164 className = "h-full w-full rounded-full"
154165 src = {
155- user . profileImageUrl ? convertUploadedImageUrl ( user . profileImageUrl ) : "/images/placeholder/profile64.svg"
166+ user ? .profileImageUrl ? convertUploadedImageUrl ( user ? .profileImageUrl ) : "/images/placeholder/profile64.svg"
156167 }
157168 width = { 40 }
158169 height = { 40 }
159170 alt = "alt"
160171 />
161172 </ div >
162- < div className = "overflow-hidden text-sm font-medium leading-normal text-black" > { user . nickname } </ div >
173+ < div className = "overflow-hidden text-sm font-medium leading-normal text-black" > { user ? .nickname } </ div >
163174 </ div >
164175 ) ;
165176} ;
0 commit comments