@@ -36,30 +36,42 @@ import getBottomSheetOptionList from '@/app/list/[listId]/_components/ListDetail
3636import ModalPortal from '@/components/modal-portal' ;
3737import BottomSheet from '@/components/BottomSheet/BottomSheet' ;
3838import Comment from '@/app/list/[listId]/_components/ListDetailOuter/Comment' ;
39+ import { CommentType } from '@/lib/types/commentType' ;
3940
4041interface BottomSheetOptionsProps {
4142 key : string ;
4243 title : string ;
4344 onClick : ( ) => void ;
4445}
46+ const convertToCommentType = ( data : NewestCommentType ) : CommentType => ( {
47+ id : 0 , // 💡 `id`가 없으므로 기본값 0 설정
48+ userId : data . userId ,
49+ userNickname : data . userNickname ,
50+ userProfileImageUrl : data . userProfileImageUrl ,
51+ createdDate : data . createdDate instanceof Date ? data . createdDate . toISOString ( ) : new Date ( ) . toISOString ( ) , // 💡 Date → string 변환
52+ updatedDate : new Date ( ) . toISOString ( ) , // 💡 최신 상태로 기본값 추가
53+ content : data . content ,
54+ replies : [ ] , // 💡 `replies`가 없으므로 빈 배열 설정
55+ isDeleted : false , // 💡 기본값 false 설정
56+ } ) ;
4557
46- const NewestComment = ( data : NewestCommentType ) => {
47- return (
48- < div >
49- < Comment
50- comment = { data }
51- setActiveNickname = { ( ) => { } }
52- activeNickname = { '' }
53- handleSetCommentId = { ( ) => { } }
54- handleSetComment = { ( ) => { } }
55- listId = { 11 }
56- commentId = { 22 }
57- // currentUserInfo={id: number,nickname: string description?: string profileImageUrl?: string backgroundImageUrl?: string followerCount: number followingCount: number isFollowed: boolean isOwner: boolean}
58- handleEdit = { ( ) => { } }
59- />
60- </ div >
61- ) ;
62- } ;
58+ // const NewestComment = ({ data }: { data: NewestCommentType } ) => {
59+ // return (
60+ // <div>
61+ // <Comment
62+ // comment={convertToCommentType( data) }
63+ // setActiveNickname={() => {}}
64+ // activeNickname={''}
65+ // handleSetCommentId={() => {}}
66+ // handleSetComment={() => {}}
67+ // listId={11}
68+ // commentId={22}
69+ // // currentUserInfo={id: number,nickname: string description?: string profileImageUrl?: string backgroundImageUrl?: string followerCount: number followingCount: number isFollowed: boolean isOwner: boolean}
70+ // handleEdit={() => {}}
71+ // />
72+ // </div>
73+ // );
74+ // };
6375
6476function ListInformation ( ) {
6577 const { language } = useLanguage ( ) ;
@@ -247,7 +259,8 @@ function ListInformation() {
247259 </ div >
248260 </ div >
249261 { /* TODO: 가장 최신 댓글 불러오는 부분 */ }
250- < NewestComment data = { list ?. newestComment } />
262+ { /* <NewestComment data={list?.newestComment} /> */ }
263+ < div > list?.newestComment.content </ div > { ' ' }
251264 </ div >
252265 ) }
253266 { isSheetActive && (
0 commit comments