//
//  CreateWorkoutSupersetActionsView.swift
//  Werkout_ios
//
//  Created by Trey Tartt on 6/18/23.
//

import SwiftUI

struct CreateWorkoutSupersetActionsView: View {
    var workoutSuperSet: CreateWorkoutSuperSet
    @Binding var showAddExercise: Bool
    var viewModel: WorkoutViewModel
    @Binding var selectedCreateWorkoutSuperSet: CreateWorkoutSuperSet?
    
    var body: some View {
        HStack {
            Button(action: {
                selectedCreateWorkoutSuperSet = workoutSuperSet
                showAddExercise.toggle()
            }) {
                Text("Add exercise")
                    .padding()
            }
            .foregroundColor(.white)
            .background(.green)
            .frame(maxWidth: .infinity, alignment: .center)
            
            Button(action: {
//                viewModel.delete(superset: workoutSuperSet)
//                viewModel.increaseRandomNumberForUpdating()
//                viewModel.objectWillChange.send()
                
            }) {
                Text("Delete superset")
                    .padding()
            }
            .foregroundColor(.white)
            .background(.red)
            .frame(maxWidth: .infinity, alignment: .center)
        }
    }
}

//struct CreateWorkoutSupersetActionsView_Previews: PreviewProvider {
//    static var previews: some View {
//        CreateWorkoutSupersetActionsView()
//    }
//}
