// // ContentPlaylistListView.swift // SodaLive // // Created by klaus on 12/7/24. // import SwiftUI struct ContentPlaylistListView: View { @StateObject var viewModel = ContentPlaylistListViewModel() let onClickCreate: () -> Void let onClickItem: (Int) -> Void var body: some View { BaseView(isLoading: $viewModel.isLoading) { VStack(spacing: 13.3) { Text("+ 새 재생목록 만들기") .font(.custom(Font.bold.rawValue, size: 14.7)) .foregroundColor(Color.white) .padding(.vertical, 13.3) .frame(maxWidth: .infinity) .background(Color.button) .cornerRadius(5.3) .contentShape(Rectangle()) .onTapGesture { onClickCreate() } if viewModel.playlists.isEmpty { VStack(spacing: 13.3) { Text("재생목록이 비어있습니다.") .font(.custom(Font.bold.rawValue, size: 14.7)) .foregroundColor(Color.grayee) Text("자주 듣는 콘텐츠를\n재생목록으로 만들어 보세요.") .font(.custom(Font.medium.rawValue, size: 11)) .foregroundColor(Color.grayee) .multilineTextAlignment(.center) } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.bg) .cornerRadius(4.7) } else { HStack(spacing: 5.3) { Text("전체") .font(.custom(Font.medium.rawValue, size: 14.7)) .foregroundColor(Color.white) Text("\(viewModel.totalCount)개") .font(.custom(Font.medium.rawValue, size: 12)) .foregroundColor(Color.gray90) Spacer() } .frame(maxWidth: .infinity) ScrollView(.vertical) { LazyVStack(spacing: 11) { ForEach(0..