2026-06-19 02:10:25 +02:00
|
|
|
import SwiftUI
|
|
|
|
|
import VoiceCatCore
|
|
|
|
|
|
|
|
|
|
struct UserListView: View {
|
|
|
|
|
@Bindable var session: SessionState
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
let channelUsers = session.currentChannelId == 0
|
|
|
|
|
? session.users
|
|
|
|
|
: session.users.filter { $0.channelId == session.currentChannelId }
|
|
|
|
|
|
|
|
|
|
List(channelUsers) { user in
|
2026-06-21 03:02:58 +02:00
|
|
|
UserRow(user: user, session: session)
|
2026-06-19 02:10:25 +02:00
|
|
|
}
|
|
|
|
|
.listStyle(.plain)
|
|
|
|
|
.overlay {
|
|
|
|
|
if channelUsers.isEmpty {
|
|
|
|
|
ContentUnavailableView(
|
|
|
|
|
"No Users",
|
|
|
|
|
systemImage: "person.slash",
|
|
|
|
|
description: Text(session.currentChannelId == 0 ? "Join a channel to see users." : "No one else here yet.")
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|