1
- import { Swiper , SwiperSlide } from ' swiper/react' ;
2
- import { css } from ' @emotion/react' ;
3
- import styled from ' @emotion/styled' ;
4
- import ' swiper/css' ;
5
- import ' swiper/css/effect-coverflow' ;
6
- import ' swiper/css/pagination' ;
1
+ import { Swiper , SwiperSlide } from " swiper/react" ;
2
+ import { css } from " @emotion/react" ;
3
+ import styled from " @emotion/styled" ;
4
+ import " swiper/css" ;
5
+ import " swiper/css/effect-coverflow" ;
6
+ import " swiper/css/pagination" ;
7
7
8
- import { Navigation } from ' swiper/modules' ;
9
- import Card from ' ./Card' ;
10
- import SwiperFooter from ' ./SwiperFooter' ;
11
- import { useEffect , useState } from ' react' ;
12
- import { getDaybookList } from ' @api' ;
13
- import { GetDaybookResponse } from ' @api/response' ;
14
- import LoadingSpinner from ' ./LoadingSpinner' ;
8
+ import { Navigation } from " swiper/modules" ;
9
+ import Card from " ./Card" ;
10
+ import SwiperFooter from " ./SwiperFooter" ;
11
+ import { useEffect , useState } from " react" ;
12
+ import { getDaybookList } from " @api" ;
13
+ import { GetDaybookResponse } from " @api/response" ;
14
+ import LoadingSpinner from " ./LoadingSpinner" ;
15
15
16
16
const MyWritingSwiper = ( ) => {
17
17
const [ data , setData ] = useState < GetDaybookResponse [ ] > ( [ ] ) ;
@@ -24,7 +24,7 @@ const MyWritingSwiper = () => {
24
24
} ) ( ) ;
25
25
} , [ ] ) ;
26
26
27
- if ( data . length < 1 ) return < LoadingSpinner /> ;
27
+ if ( ! data ? .length ) return < LoadingSpinner /> ;
28
28
29
29
return (
30
30
< >
@@ -53,7 +53,7 @@ const MyWritingSwiper = () => {
53
53
< Card isCurrent = { currentIndex === i } daybook = { daybook } />
54
54
</ CardSlide >
55
55
) ) }
56
- < SwiperFooter maxIndex = { data . length } currentIndex = { currentIndex } />
56
+ < SwiperFooter maxIndex = { data ? .length } currentIndex = { currentIndex } />
57
57
</ Swiper >
58
58
</ >
59
59
) ;
0 commit comments