//
//  ContentMainMyStashView.swift
//  SodaLive
//
//  Created by klaus on 2023/08/11.
//

import SwiftUI

struct ContentMainMyStashView: View {
    
    let items: [GetAudioContentMainItem]
    
    var body: some View {
        VStack(alignment: .leading, spacing: 13.3) {
            HStack(spacing: 0) {
                Text("내 보관함")
                    .font(.custom(Font.bold.rawValue, size: 18.3))
                    .foregroundColor(Color(hex: "eeeeee"))
                
                Spacer()
                
                Text("전체보기")
                    .font(.custom(Font.light.rawValue, size: 11.3))
                    .foregroundColor(Color(hex: "bbbbbb"))
                    .onTapGesture {}
            }
            
            ScrollView(.horizontal, showsIndicators: false) {
                LazyHStack(alignment: .top, spacing: 13.3) {
                    ForEach(0..<items.count, id: \.self) { index in
                        let item = items[index]
                        ContentMainItemView(item: item)
                    }
                }
            }
        }
    }
}

struct ContentMainMyStashView_Previews: PreviewProvider {
    static var previews: some View {
        ContentMainMyStashView(
            items: [
                GetAudioContentMainItem(
                    contentId: 1,
                    coverImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
                    title: "테스트",
                    isAdult: false,
                    creatorId: 7,
                    creatorProfileImageUrl: "https://test-cf.sodalive.net/profile/default-profile.png",
                    creatorNickname: "유저1"
                )
            ]
        )
    }
}