//
//  ConversationView.swift
//  kordophone2
//
//  Created by James Magahern on 8/24/25.
//

import SwiftUI
import UniformTypeIdentifiers

struct ConversationView: View
{
    @Binding var transcriptModel: TranscriptView.ViewModel
    @Binding var entryModel: MessageEntryView.ViewModel
    
    var body: some View {
        VStack(spacing: 0.0) {
            TranscriptView(model: $transcriptModel)
            MessageEntryView(viewModel: $entryModel)
        }
        
        .onDrop(of: [UTType.image, UTType.fileURL], isTargeted: $entryModel.isDropTargeted) { providers in
            entryModel.handleDroppedProviders(providers)
            return true
        }

        .onHover { isHovering in
            guard isHovering else { return } 
            transcriptModel.setNeedsMarkAsRead()
        }
    }
}
