// // UserProfileLiveView.swift // SodaLive // // Created by klaus on 2023/08/11. // import SwiftUI import Kingfisher struct UserProfileLiveView: View { let userId: Int let liveRoomList: [LiveRoomResponse] let onClickParticipant: (LiveRoomResponse) -> Void let onClickReservation: (LiveRoomResponse) -> Void var body: some View { VStack(spacing: 13.3) { ForEach(0.. 0 { HStack(spacing: 2) { Image("ic_can") .resizable() .scaledToFit() .frame(width: 12) Text("\(item.price)") .font(.custom(Font.preRegular.rawValue, size: 12)) .foregroundColor(.white) } .padding(4) .frame(maxWidth: .infinity) .background(Color(hex: "3b5ff1")) .cornerRadius(4) } else { Text("무료") .font(.custom(Font.preRegular.rawValue, size: 14)) .foregroundColor(Color(hex: "#263238")) .padding(4) .frame(maxWidth: .infinity) .background(Color.white) .cornerRadius(4) } } .frame(width: 55) } .padding(10) .background(Color(hex: "263238")) .cornerRadius(16) .contentShape(Rectangle()) .onTapGesture { if item.isActive && !item.channelName.isNullOrBlank() { onClickParticipant(item) } else { if !item.isReservation { onClickReservation(item) } } } } } } }