@@ -21,22 +21,29 @@ function LikedMusical() {
2121
2222
2323 return (
24+
2425 < Container >
25- < MusicalList >
26- { data ?. result ?. map ( ( musical ) => (
27- < Card key = { musical . id } onClick = { ( ) => navigate ( `/detail/${ musical . id } ` ) } >
28- < Image src = { musical . posterUrl } alt = { musical . name } />
29- < CardHeader >
30- < CardTitle > { musical . name } </ CardTitle >
31- < LikeButton >
32- < img src = { Heart } alt = "Like" width = { 24 } height = { 24 } />
33- </ LikeButton >
34- </ CardHeader >
35- < Theater > { musical . place } </ Theater >
36- < Period > { musical . duration } </ Period >
37- </ Card >
38- ) ) }
39- </ MusicalList >
26+ { loading && < div style = { { marginTop :'32px' } } > 로딩 중...</ div > }
27+ { error && < div style = { { marginTop :'32px' } } > 에러 발생: { error } </ div > }
28+ { data ?. result ?. length > 0 ? (
29+ < MusicalList >
30+ { data . result . map ( ( musical ) => (
31+ < Card key = { musical . id } onClick = { ( ) => navigate ( `/detail/${ musical . id } ` ) } >
32+ < Image src = { musical . posterUrl } alt = { musical . name } />
33+ < CardHeader >
34+ < CardTitle > { musical . name } </ CardTitle >
35+ < LikeButton >
36+ < img src = { Heart } alt = "Like" width = { 24 } height = { 24 } />
37+ </ LikeButton >
38+ </ CardHeader >
39+ < Theater > { musical . place } </ Theater >
40+ < Period > { musical . duration } </ Period >
41+ </ Card >
42+ ) ) }
43+ </ MusicalList >
44+ ) : (
45+ < p style = { { marginTop :'32px' } } > 좋아요한 뮤지컬이 없습니다.</ p >
46+ ) }
4047 </ Container >
4148 ) ;
4249}
@@ -47,8 +54,7 @@ export default LikedMusical;
4754const Container = styled . div `
4855 display: flex;
4956 max-width: 1440px;
50- height: 864px;
51- margin-top:30px;
57+
5258` ;
5359
5460
@@ -57,7 +63,7 @@ const MusicalList = styled.div`
5763 grid-template-columns: repeat(3, 1fr); /* 한 줄에 3개 */
5864 gap: 6px; /* 카드 간 간격 */
5965 margin-left: -35px;
60-
66+ margin-top:30px;
6167` ;
6268
6369const Card = styled . div `
0 commit comments