Last active
          April 12, 2024 02:40 
        
      - 
      
- 
        Save apatronl/3b4872a85cdc46f07cf7bee4b27c0646 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import SwiftUI | |
| struct ChatMessagesList: View { | |
| @Bindable var viewModel: ChatViewModel | |
| var body: some View { | |
| ScrollView { | |
| ForEach(viewModel.messages) { message in | |
| MessageCell(message: message) | |
| .padding(message.role.padding) | |
| .id(message.id) | |
| } | |
| } | |
| .scrollPosition(id: $viewModel.scrollPosition) | |
| .defaultScrollAnchor(.bottom) | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment