]>
Commit | Line | Data |
---|---|---|
4635f59d | 1 | export interface ComponentPagination { |
d592e0a9 C |
2 | currentPage: number |
3 | itemsPerPage: number | |
b1fa3eba | 4 | totalItems?: number |
d592e0a9 | 5 | } |
2f1548fd C |
6 | |
7 | export function hasMoreItems (componentPagination: ComponentPagination) { | |
8 | // No results | |
9 | if (componentPagination.totalItems === 0) return false | |
10 | ||
11 | // Not loaded yet | |
12 | if (!componentPagination.totalItems) return true | |
13 | ||
14 | const maxPage = componentPagination.totalItems / componentPagination.itemsPerPage | |
15 | return maxPage > componentPagination.currentPage | |
16 | } |