initial commit

This commit is contained in:
2026-04-04 22:13:55 -04:00
commit 5d77e207c9
10181 changed files with 522212 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
export function getPageNumbers(current: number, total: number, maxButtons = 7) {
const pages: (number | "...")[] = [];
if (total <= maxButtons) {
for (let i = 1; i <= total; i++) pages.push(i);
return pages;
}
const delta = 2;
const start = Math.max(2, current - delta);
const end = Math.min(total - 1, current + delta);
pages.push(1);
if (start > 2) pages.push("...");
for (let i = start; i <= end; i++) pages.push(i);
if (end < total - 1) pages.push("...");
if (total > 1) pages.push(total);
return pages;
}