hensei-web/hooks/usePaginationState.tsx
Justin Edmund 8164f1f0d4 Break collection pages into hooks
This refactors the collection pages (teams, saved and profiles) into a bunch of hooks that handle various chunks of functionality. This way, the actual "pages" have significantly less logic.
2024-04-21 00:42:12 -07:00

16 lines
357 B
TypeScript

import { useState } from 'react'
export const usePaginationState = () => {
const [currentPage, setCurrentPage] = useState(1)
const [totalPages, setTotalPages] = useState(1)
const [recordCount, setRecordCount] = useState(0)
return {
currentPage,
setCurrentPage,
totalPages,
setTotalPages,
recordCount,
setRecordCount,
}
}