pagination
This commit is contained in:
@@ -11,11 +11,12 @@ import { UserItemType } from './types/UserTypes'
|
||||
import PageLoading from '../../components/PageLoading'
|
||||
import { toast } from 'react-toastify'
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
|
||||
import Pagination from '../../components/Pagination'
|
||||
const UsersList: FC = () => {
|
||||
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('global')
|
||||
const [page, setPage] = useState<number>(1)
|
||||
const [search, setSearch] = useState<string>('')
|
||||
const getUsers = useGetUsers(search)
|
||||
const deleteUser = useDeleteUser()
|
||||
@@ -117,6 +118,12 @@ const UsersList: FC = () => {
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<Pagination
|
||||
totalPages={getUsers.data?.data?.pager?.totalPages}
|
||||
currentPage={page}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user