// // AudioContentDeleteDialogView.swift // SodaLive // // Created by klaus on 2023/08/13. // import SwiftUI struct AudioContentDeleteDialogView: View { @Binding var isShowing: Bool let title: String let confirmAction: () -> Void let showToast: () -> Void @State private var isAgree = false var body: some View { VStack(spacing: 0) { Text(I18n.ContentDetail.DeleteDialog.title) .appFont(size: 18.3, weight: .bold) .foregroundColor(Color(hex: "eeeeee")) Text(I18n.ContentDetail.DeleteDialog.confirmQuestion(title)) .appFont(size: 13.3, weight: .medium) .foregroundColor(Color(hex: "eeeeee")) .padding(.top, 21.3) HStack(spacing: 13.3) { Image(isAgree ? "btn_select_checked" : "btn_select_normal") .resizable() .frame(width: 20, height: 20) .onTapGesture { isAgree.toggle() } Text(I18n.ContentDetail.DeleteDialog.irreversibleAcknowledgement) .appFont(size: 12, weight: .medium) .foregroundColor(Color(hex: "eeeeee")) .onTapGesture { isAgree.toggle() } } .padding(13.3) .background(Color(hex: "303030")) .cornerRadius(6.7) .padding(.top, 13.3) Text(I18n.ContentDetail.DeleteDialog.purchasedUserNotice) .appFont(size: 12, weight: .medium) .foregroundColor(Color(hex: "dd4500")) .fixedSize(horizontal: false, vertical: true) .multilineTextAlignment(.center) .padding(.top, 13.3) HStack(spacing: 12) { Text(I18n.Common.cancel) .appFont(size: 18.3, weight: .bold) .foregroundColor(Color(hex: "9970ff")) .padding(.horizontal, 55) .padding(.vertical, 16) .overlay( RoundedRectangle(cornerRadius: CGFloat(10)) .stroke(lineWidth: 1) .foregroundColor(Color(hex: "9970ff")) ) .onTapGesture { isShowing = false } Text(I18n.Common.confirm) .appFont(size: 18.3, weight: .bold) .foregroundColor(Color(hex: "eeeeee")) .padding(.horizontal, 55) .padding(.vertical, 16) .background(Color(hex: "9970ff")) .cornerRadius(10) .onTapGesture { if isAgree { isShowing = false confirmAction() } else { showToast() } } } .padding(.top, 13.3) } .padding(.top, 40) .padding(.horizontal, 16.7) .padding(.bottom, 16.7) .background(Color(hex: "222222")) .cornerRadius(10) } }