pagination
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { FC } from 'react'
|
||||
import { FC, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
@@ -8,11 +8,12 @@ import { useGetLearning } from './hooks/useLearningData'
|
||||
import PageLoading from '../../components/PageLoading'
|
||||
import Td from '../../components/Td'
|
||||
import { LearningItemType } from './types/LearningTypes'
|
||||
|
||||
import Pagination from '../../components/Pagination'
|
||||
const LearningList: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
const getLearning = useGetLearning()
|
||||
const [page, setPage] = useState<number>(1)
|
||||
const getLearning = useGetLearning(page)
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
@@ -72,6 +73,11 @@ const LearningList: FC = () => {
|
||||
</div>
|
||||
}
|
||||
|
||||
<Pagination
|
||||
currentPage={page}
|
||||
onPageChange={setPage}
|
||||
totalPages={getLearning.data?.data?.pager?.totalPages}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user