// // LiveRoomInfoGuestView.swift // SodaLive // // Created by klaus on 2024/01/17. // import SwiftUI struct LiveRoomInfoGuestView: View { let title: String let totalDonationCan: Int let isOnBg: Bool let isOnNotice: Bool let isOnMenuPan: Bool let isOnSignature: Bool let isShowMenuPanButton: Bool let creatorId: Int let creatorNickname: String let creatorProfileUrl: String let speakerList: [LiveRoomMember] let muteSpeakerList: [UInt] let activeSpeakerList: [UInt] let isFollowing: Bool let isAdult: Bool let onClickQuit: () -> Void let onClickToggleBg: () -> Void let onClickShare: () -> Void let onClickFollow: (Bool) -> Void let onClickProfile: (Int) -> Void let onClickNotice: () -> Void let onClickMenuPan: () -> Void let onClickTotalDonation: () -> Void let onClickChangeListener: () -> Void let onClickToggleSignature: () -> Void var body: some View { ZStack { VStack(spacing: 13.3) { HStack(spacing: 5.3) { LiveRoomOverlayStrokeTextButton( text: "나가기", textColor: Color.red, strokeColor: Color.red, strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickQuit() } Spacer() if speakerList.contains(where: { $0.id == UserDefaults.int(forKey: .userId)}) { LiveRoomOverlayStrokeTextButton( text: "리스너 변경", textColor: Color.grayee, strokeColor: Color.graybb, strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickChangeListener() } } LiveRoomOverlayStrokeTextToggleButton( isOn: isOnSignature, onText: "시그 ON", onTextColor: Color.button, onStrokeColor: Color.button, offText: "시그 OFF", offTextColor: Color.graybb, offStrokeColor: Color.graybb, strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickToggleSignature() } LiveRoomOverlayStrokeTextToggleButton( isOn: isOnBg, onText: "배경 ON", onTextColor: Color.button, onStrokeColor: Color.button, offText: "배경 OFF", offTextColor: Color.graybb, offStrokeColor: Color.graybb, strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickToggleBg() } LiveRoomOverlayStrokeImageButton( imageName: "ic_share", strokeColor: Color.graybb, strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickShare() } } HStack(spacing: 8) { LiveRoomInfoCreatorView( roomTitle: title, creatorNickname: creatorNickname, creatorProfileUrl: creatorProfileUrl, isMute: muteSpeakerList.contains(UInt(creatorId)), isAdult: isAdult, isFollowing: isFollowing, isActiveSpeaker: activeSpeakerList.contains(UInt(creatorId)), isShowFollowingButton: true, onClickFollow: { onClickFollow(isFollowing) }, onClickProfile: { onClickProfile(creatorId) } ) Spacer() ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 8) { ForEach(0..