a native ios client for gitbay

client ios swift

https://gitbay.org

gitbay/Views/Repos/PageFooter.swift

21 lines · 546 bytes

 1import SwiftUI
 2
 3/// The last row of a paginated list: appears, fetches the next page,
 4/// re-arms after each append until the server stops sending a cursor.
 5struct PageFooter<Element: Decodable & Sendable>: View {
 6
 7    let list: PagedListModel<Element>
 8
 9    var body: some View {
10        if list.hasMore {
11            HStack {
12                Spacer()
13                ProgressView()
14                Spacer()
15            }
16            .task(id: list.state.value?.count ?? 0) {
17                await list.loadMore()
18            }
19        }
20    }
21}