mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-15 19:56:36 +00:00
d1209e6704
Co-authored-by: Jim Dovey <jimdovey@apple.com>
26 lines
841 B
Swift
26 lines
841 B
Swift
import Foundation
|
|
|
|
public struct Conversation: Identifiable, Decodable, Hashable, Equatable {
|
|
public let id: String
|
|
public let unread: Bool
|
|
public let lastStatus: Status?
|
|
public let accounts: [Account]
|
|
|
|
public init(id: String, unread: Bool, lastStatus: Status? = nil, accounts: [Account]) {
|
|
self.id = id
|
|
self.unread = unread
|
|
self.lastStatus = lastStatus
|
|
self.accounts = accounts
|
|
}
|
|
|
|
public static func placeholder() -> Conversation {
|
|
.init(id: UUID().uuidString, unread: false, lastStatus: .placeholder(), accounts: [.placeholder()])
|
|
}
|
|
|
|
public static func placeholders() -> [Conversation] {
|
|
[.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder(),
|
|
.placeholder(), .placeholder(), .placeholder(), .placeholder(), .placeholder()]
|
|
}
|
|
}
|
|
|
|
extension Conversation: Sendable {}
|