aboutsummaryrefslogtreecommitdiff
path: root/Hotline/State/ServerState.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-11-27 23:38:04 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-11-27 23:38:04 +0100
commit213710bf5bd6413c747bf126db50816ef5de5a6e (patch)
tree912f8cf87955a08077c92fea8ad934f50b7ab975 /Hotline/State/ServerState.swift
parentf466b21dc02f78c984ba6748e703f6780a7a0db4 (diff)
parent6a95b53616a4abfa306ddce43151cf4fefbd20ed (diff)
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'Hotline/State/ServerState.swift')
-rw-r--r--Hotline/State/ServerState.swift46
1 files changed, 46 insertions, 0 deletions
diff --git a/Hotline/State/ServerState.swift b/Hotline/State/ServerState.swift
new file mode 100644
index 0000000..3fe10f9
--- /dev/null
+++ b/Hotline/State/ServerState.swift
@@ -0,0 +1,46 @@
+import SwiftUI
+
+@Observable
+class ServerState: Equatable {
+ var id: UUID = UUID()
+ var selection: ServerNavigationType
+ var serverName: String? = nil
+ var accountsShown: Bool = false
+ var broadcastShown: Bool = false
+// var serverBanner: NSImage? = nil
+// var bannerBackgroundColor: Color? = nil
+
+ init(selection: ServerNavigationType) {
+ self.selection = selection
+ }
+
+ static func == (lhs: ServerState, rhs: ServerState) -> Bool {
+ return lhs.id == rhs.id
+ }
+}
+
+enum ServerNavigationType: Identifiable, Hashable, Equatable {
+ var id: String {
+ switch self {
+ case .chat:
+ return "Chat"
+ case .news:
+ return "News"
+ case .board:
+ return "Board"
+ case .files:
+ return "Files"
+// case .accounts:
+// return "Accounts"
+ case .user(let userID):
+ return String(userID)
+ }
+ }
+
+ case chat
+ case news
+ case board
+ case files
+// case accounts
+ case user(userID: UInt16)
+}