// // UserReportDialogView.swift // SodaLive // // Created by klaus on 2023/08/11. // import SwiftUI struct UserReportDialogView: View { @Binding var isShowing: Bool let confirmAction: (String) -> Void @State private var selectedIndex: Int? = nil let reasons = [ "괴롭힘 및 사이버 폭력", "개인정보 침해", "명의 도용", "폭력적 위협", "아동 학대", "보호 대상 집단에 대한 증오심 표현", "스팸 및 사기", "나에게 해당하는 문제 없음" ] var body: some View { ZStack { Color.black .opacity(0.7) .ignoresSafeArea() .onTapGesture { isShowing = false } VStack(spacing: 13.3) { Text("사용자 신고") .font(.custom(Font.medium.rawValue, size: 16.7)) .foregroundColor(Color(hex: "eeeeee")) VStack(spacing: 13.3) { ForEach(0..<reasons.count, id: \.self) { index in let reason = reasons[index] HStack(spacing: 8) { Image(selectedIndex == index ? "btn_radio_select_selected" : "btn_radio_select_normal") .resizable() .frame(width: 20, height: 20) Text(reason) .font(.custom(Font.medium.rawValue, size: 14)) .foregroundColor(Color(hex: "909090")) Spacer() } .onTapGesture { selectedIndex = index } } } .padding(.vertical, 3.3) HStack(spacing: 26.7) { Spacer() Text("취소") .font(.custom(Font.medium.rawValue, size: 13.3)) .foregroundColor(Color(hex: "3bb9f1")) .onTapGesture { isShowing = false } Text("신고") .font(.custom(Font.medium.rawValue, size: 13.3)) .foregroundColor(Color(hex: "3bb9f1")) .onTapGesture { if let selectedIndex = selectedIndex { isShowing = false confirmAction(reasons[selectedIndex]) } } } .padding(.top, 13.3) } .padding(24) .frame(width: screenSize().width - 33.3) .background(Color(hex: "222222")) .cornerRadius(13.3) } } }