// // HomeLiveItemView.swift // SodaLive // // Created by klaus on 7/11/25. // import SwiftUI import Kingfisher struct HomeLiveItemView: View { let item: GetRoomListResponse let onClickItem: (Int) -> Void var body: some View { HStack(spacing: 16) { ZStack(alignment: .bottom) { ZStack { KFImage(URL(string: item.creatorProfileImage)) .cancelOnDisappear(true) .resizable() .frame(width: 62, height: 62) .clipShape(Circle()) } .padding(7) .overlay { Circle() .strokeBorder(lineWidth: 3) .foregroundColor(.button) } Image("img_live") .resizable() .frame(width: 50, height: 18) } VStack(alignment: .leading, spacing: 4) { Text(item.creatorNickname) .font(.custom(Font.preRegular.rawValue, size: 18)) .foregroundColor(.white) .lineLimit(2) .truncationMode(.tail) Text(item.title) .font(.custom(Font.preRegular.rawValue, size: 14)) .foregroundColor(Color(hex: "B0BEC5")) .lineLimit(1) .truncationMode(.tail) } } .padding(.leading, 14) .padding(.trailing, 16) .padding(.vertical, 10) .frame(width: 282, alignment: .leading) .background(Color(hex: "263238")) .cornerRadius(999) .contentShape(Rectangle()) .onTapGesture { onClickItem(item.roomId) } } } #Preview { HomeLiveItemView( item: GetRoomListResponse( roomId: 1, title: "네네코 마사로네네코 마사로네네코 마사로네네코 마사로", content: "테스트", beginDateTime: "2025-08-10 15:00:00", numberOfParticipate: 1, numberOfPeople: 10, coverImageUrl: "https://cf.sodalive.net/live_room_cover/18038/18038-cover-8c3cb985-733d-4425-8eaf-ef753064d371-2283-1751800412922", isAdult: false, price: 0, tags: [""], channelName: "", creatorProfileImage: "https://cf.sodalive.net/profile/34806/34806-profile-49db6b45-bb1e-4dc7-917e-1a614a853f5f-4232-1752158072656", creatorNickname: "설린", creatorId: 1, isReservation: false, isPrivateRoom: false ) ) { _ in } }