@@ -9,14 +9,23 @@ import PageTitle from './components/AdminPageTitle';
99import RollingPaperItem from './components/RollingPaperItem' ;
1010import WrapperFrame from './components/WrapperFrame' ;
1111import WrapperTitle from './components/WrapperTitle' ;
12+ import PagenationNavigation from './components/PagenationNavigation' ;
13+
14+ const SIZE = 10 ;
1215
1316export default function AdminRollingPaper ( ) {
1417 const [ activeModal , setActiveModal ] = useState ( false ) ;
15- const { data, isLoading, isSuccess } = useQuery ( {
16- queryKey : [ 'admin-rolling-paper' ] ,
17- queryFn : getRollingPaperList ,
18+ const [ currentPage , setCurrentPage ] = useState < string > ( '1' ) ;
19+ const { data, isLoading, isSuccess, refetch } = useQuery ( {
20+ queryKey : [ 'admin-rolling-paper' , currentPage ] ,
21+ queryFn : ( ) => getRollingPaperList ( currentPage ?? 1 , SIZE ) ,
1822 } ) ;
1923
24+ const handleNowPage = ( page : string ) => {
25+ setCurrentPage ( page ) ;
26+ refetch ( ) ;
27+ } ;
28+
2029 return (
2130 < >
2231 { activeModal && < AddRollingPaperModal onClose = { ( ) => setActiveModal ( false ) } /> }
@@ -58,7 +67,11 @@ export default function AdminRollingPaper() {
5867 ) }
5968 </ >
6069 ) }
61- { /* TODO: 페이지네이션 적용 */ }
70+ < PagenationNavigation
71+ totalPage = { Number ( data ?. totalPages ) }
72+ buttonLength = { 5 }
73+ handlePageNumberButtonClick = { handleNowPage }
74+ />
6275 </ WrapperFrame >
6376 </ >
6477 ) ;
0 commit comments