// // 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(I18n.Content.Playlist.createNewAction) .appFont(size: 14.7, weight: .bold) .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(I18n.Content.Playlist.emptyTitle) .appFont(size: 14.7, weight: .bold) .foregroundColor(Color.grayee) Text(I18n.Content.Playlist.emptyDescription) .appFont(size: 11, weight: .medium) .foregroundColor(Color.grayee) .multilineTextAlignment(.center) } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.bg) .cornerRadius(4.7) } else { HStack(spacing: 5.3) { Text(I18n.Content.Playlist.totalLabel) .appFont(size: 14.7, weight: .medium) .foregroundColor(Color.white) Text("\(viewModel.totalCount)\(I18n.Content.Count.countUnit)") .appFont(size: 12, weight: .medium) .foregroundColor(Color.gray90) Spacer() } .frame(maxWidth: .infinity) ScrollView(.vertical) { LazyVStack(spacing: 11) { ForEach(0..