pagination

This commit is contained in:
hamid zarghami
2025-05-12 11:43:48 +03:30
parent 052280a009
commit cad29d587c
16 changed files with 90 additions and 33 deletions
+9 -3
View File
@@ -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>
)
}