refactor: add color assets and update UI components

This commit is contained in:
2026-03-16 16:36:21 +07:00
parent 37b87ececd
commit d991d06f17
25 changed files with 532 additions and 160 deletions
+16 -7
View File
@@ -2,16 +2,25 @@ import Foundation
import SwiftUI
import UIKit
@Observable
@MainActor
class NotificationsViewModel: ObservableObject {
@Published var notifications: [AppNotification] = []
@Published var unreadCount = 0
@Published var isLoading = false
@Published var isLoadingMore = false
@Published var error: String?
@Published var hasMore = true
final class NotificationsViewModel {
var notifications: [AppNotification] = []
var unreadCount = 0
var isLoading = false
var isLoadingMore = false
var error: String?
var hasMore = true
private var hasLoadedOnce = false
var unreadNotifications: [AppNotification] {
notifications.filter { !$0.isRead }
}
var readNotifications: [AppNotification] {
notifications.filter { $0.isRead }
}
private let service = NotificationsAPIService.shared
private let limit = 50
private var currentOffset = 0