//
//  YesNoButtons.swift
//  Sailassist
//
//  Created by Mamoru Sugita on 2023/12/14.
//

import SwiftUI

struct YesNoButtons: View {
    var yesTitle: String
    var noTitle: String
    
    var yesAction: () -> Void
    var noAction: () -> Void
    
    var body: some View {
        HStack(spacing: 5){
            Button(action: yesAction, label: {
                Text(yesTitle)
                    .frame(maxWidth: .infinity)
                    .padding(.vertical, 10)
                    .border(ColorSet.LineColor04.color, width: 1, cornerRadius: 5)
                
            })
            Button(action: noAction, label: {
                Text(noTitle)
                    .frame(maxWidth: .infinity)
                    .padding(.vertical, 10)
                    .border(ColorSet.LineColor04.color, width: 1, cornerRadius: 5)
                
            })
        }
        .padding()
        .background(ColorSet.BackgroundPrimary.color)
    }
}

#Preview {
    YesNoButtons(yesTitle: "Yes", noTitle: "No"){
        
    } noAction: {
        
    }
}
