pagination
This commit is contained in:
@@ -10,11 +10,13 @@ import { useGetBlogs, useDeleteBlog } from './hooks/useBlogData'
|
||||
import { BlogItemType } from './types/BlogTypes'
|
||||
import moment from 'moment-jalaali'
|
||||
import TrashWithConfrim from '../../components/TrashWithConfrim'
|
||||
import Pagination from '../../components/Pagination'
|
||||
const BlogList: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
const [page, setPage] = useState<number>(1)
|
||||
const [search, setSearch] = useState<string>('')
|
||||
const getBlogs = useGetBlogs(search);
|
||||
const getBlogs = useGetBlogs(search, page);
|
||||
const deleteBlog = useDeleteBlog()
|
||||
|
||||
return (
|
||||
@@ -154,6 +156,12 @@ const BlogList: FC = () => {
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<Pagination
|
||||
currentPage={page}
|
||||
onPageChange={setPage}
|
||||
totalPages={getBlogs.data?.data?.pager?.totalPages}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user