11import EmotionBadge from '@/components/EmotionBadge' ;
22import ChatActionButtons from '@/components/modalSheet/ChatActionButtons' ;
3- import defaultImage from '@assets/images/default.png' ;
43import { useQuery } from '@tanstack/react-query' ;
54import { getEmotionRecordById } from '@/apis/emotionRecord' ;
65import { formatDate } from '@/utils/formatDate' ;
76import ModalSheetLayoutTemp from '@/layouts/ModalSheetLayoutTemp' ;
87import { useParams } from 'react-router' ;
98import { Loading } from '@/components/loading' ;
9+ import ImageKitImg from '@/components/ImageKitImg' ;
1010
1111interface CardDetailModalProps { }
1212
13- function CardDetailModalTemp ( { } : CardDetailModalProps ) {
13+ function CardDetailModal ( { } : CardDetailModalProps ) {
1414 const id = useParams ( ) . id ! ;
1515
1616 const { data : record , isLoading } = useQuery ( {
@@ -27,7 +27,6 @@ function CardDetailModalTemp({}: CardDetailModalProps) {
2727 < div className = "flex flex-col items-center gap-1" >
2828 < div className = "flex items-center gap-1 caption-r text-gray-60" >
2929 < span > { record ?. nickName } </ span >
30- { /* <img src={headsetIcon} alt="헤드셋 아이콘" /> */ }
3130 </ div >
3231 < div className = "flex items-center gap-2" >
3332 < span className = " font-light text-gray-60 text-[10px]" >
@@ -39,15 +38,11 @@ function CardDetailModalTemp({}: CardDetailModalProps) {
3938
4039 < div className = "flex flex-col gap-2 max-w-[250px]" >
4140 < div className = "flex flex-col items-center gap-2" >
42- < img
41+ < ImageKitImg
4342 src = { record ?. spotifyMusic . albumImage }
44- alt = "앨범 이미지"
45- onError = { ( e ) => {
46- const target = e . target as HTMLImageElement ;
47- target . onerror = null ; // 무한 루프 방지
48- target . src = defaultImage ; // 기본 이미지로 변경
49- } }
50- className = "w-[80px] h-[80px] rounded-[8px]"
43+ height = { 80 }
44+ width = { 80 }
45+ className = "rounded-lg"
5146 />
5247 < div className = "flex flex-col items-center min-w-0" >
5348 < span className = "overflow-hidden body-large-b text-ellipsis whitespace-nowrap" >
@@ -75,8 +70,4 @@ function CardDetailModalTemp({}: CardDetailModalProps) {
7570 ) ;
7671}
7772
78- export default CardDetailModalTemp ;
79-
80- // 사용예시
81-
82- // <CardDetailModal recordId={selectedRecordId} isChatting={true} />;
73+ export default CardDetailModal ;
0 commit comments