Rename daco to shownPages

This commit is contained in:
Michal Vanko 2023-02-21 22:03:16 +01:00
parent 3b80a0602f
commit 0a9c666cff

View File

@ -15,7 +15,9 @@ export function getPaginatorPages({
const maxLinksLength = 7 const maxLinksLength = 7
const linksAroundActive = 2 const linksAroundActive = 2
const totalPages = Math.ceil(totalCount / pageSize) const totalPages = Math.ceil(totalCount / pageSize)
const daco = range(1, totalPages + 1).reduce<(number | typeof Divider)[]>((acc, link) => { const shownPages = range(1, totalPages + 1).reduce<
(number | typeof Divider)[]
>((acc, link) => {
const isFirst = link === 1 const isFirst = link === 1
const isLast = link === totalPages const isLast = link === totalPages
const isPageOnStart = page <= 3 && link < maxLinksLength const isPageOnStart = page <= 3 && link < maxLinksLength
@ -36,7 +38,7 @@ export function getPaginatorPages({
return [...acc, link] return [...acc, link]
}, []) }, [])
return daco return shownPages
} }
export function createHref( export function createHref(