Skip to content

Instantly share code, notes, and snippets.

@apatronl
Last active May 1, 2024 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apatronl/0227013e10273e12e14065b4246aebe8 to your computer and use it in GitHub Desktop.
Save apatronl/0227013e10273e12e14065b4246aebe8 to your computer and use it in GitHub Desktop.
@MainActor
struct ChatView: View {
@Bindable private var viewModel: ChatViewModel = ChatViewModel()
var body: some View {
NavigationStack {
VStack {
ChatMessagesList(viewModel: viewModel)
HStack {
MessageTextField(draftMessage: $viewModel.draftMessage)
SendMessageButton {
viewModel.sendMessage()
}
}
.padding(8)
}
.navigationTitle("Chat")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment