Improve mobile UI and add infinite scroll

This commit is contained in:
sas.fajri
2026-05-04 10:44:38 +07:00
parent b07f04217e
commit 7c378f78bf
17 changed files with 729 additions and 115 deletions

View File

@@ -99,3 +99,21 @@ func FilterResultRows(rows []ResultRow, search, filter string) []ResultRow {
}
return out
}
func PaginateResultRows(rows []ResultRow, page, pageSize int) ([]ResultRow, bool) {
if page < 1 {
page = 1
}
if pageSize < 1 {
pageSize = 30
}
start := (page - 1) * pageSize
if start >= len(rows) {
return []ResultRow{}, false
}
end := start + pageSize
if end > len(rows) {
end = len(rows)
}
return rows[start:end], end < len(rows)
}