change chat list

This commit is contained in:
cheykrym 2025-10-08 05:03:46 +03:00
parent 0359616c8f
commit aa4b871c41

View File

@ -56,10 +56,6 @@ struct ChatsTab: View {
private var content: some View {
if viewModel.isInitialLoading && viewModel.chats.isEmpty {
loadingState
} else if let message = viewModel.errorMessage, viewModel.chats.isEmpty {
errorState(message: message)
} else if viewModel.chats.isEmpty {
emptyState
} else {
chatList
}
@ -73,7 +69,7 @@ struct ChatsTab: View {
// .padding(.vertical, 8)
// }
// .background(Color(UIColor.systemBackground))
if let message = viewModel.errorMessage {
Section {
HStack(alignment: .top, spacing: 8) {
@ -110,12 +106,19 @@ struct ChatsTab: View {
globalSearchContent
}
} else {
ForEach(viewModel.chats) { chat in
chatRowItem(for: chat)
}
if viewModel.isLoadingMore {
loadingMoreRow
if let message = viewModel.errorMessage, viewModel.chats.isEmpty {
errorState(message: message)
} else if viewModel.chats.isEmpty {
emptyState
} else {
ForEach(viewModel.chats) { chat in
chatRowItem(for: chat)
}
if viewModel.isLoadingMore {
loadingMoreRow
}
}
}
}