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
+8 -1
View File
@@ -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>