import SwiftUI

struct IncomingCallView: View {
    @EnvironmentObject var viewModel: CallViewModel
    
    var body: some View {
        VStack(spacing: 30) {
            Text("Incoming Call")
                .font(.largeTitle)
                .fontWeight(.bold)
            
            Text("from \(viewModel.callState.remoteUser ?? "Unknown")")
                .font(.title)
            
            HStack(spacing: 40) {
                Button(action: {
                    viewModel.declineCall()
                }) {
                    VStack {
                        Image(systemName: "phone.down.fill")
                            .font(.largeTitle)
                            .padding()
                            .background(Color.red)
                            .foregroundColor(.white)
                            .clipShape(Circle())
                        Text("Decline")
                    }
                }
                
                Button(action: {
                    viewModel.acceptCall()
                }) {
                    VStack {
                        Image(systemName: "phone.fill")
                            .font(.largeTitle)
                            .padding()
                            .background(Color.green)
                            .foregroundColor(.white)
                            .clipShape(Circle())
                        Text("Accept")
                    }
                }
            }
        }
    }
}
