//
//  ScenicPromotionLoadingView.swift
//  suixinkan
//
//  Created by Codex on 2026/7/2.
//

import SwiftUI

/// 宣传页 Loading 骨架屏，尺寸跟正常模块保持一致。
struct ScenicPromotionLoadingView: View {
    var body: some View {
        ScrollView(showsIndicators: false) {
            VStack(spacing: 18) {
                RoundedRectangle(cornerRadius: 18)
                    .fill(.white.opacity(0.72))
                    .frame(height: 110)
                RoundedRectangle(cornerRadius: 16)
                    .fill(.white.opacity(0.72))
                    .frame(height: 50)
                LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: 3), spacing: 12) {
                    ForEach(0..<3, id: \.self) { _ in
                        RoundedRectangle(cornerRadius: 14)
                            .fill(.white.opacity(0.72))
                            .frame(height: 92)
                    }
                }
                RoundedRectangle(cornerRadius: 18)
                    .fill(.white.opacity(0.72))
                    .frame(height: 96)
                RoundedRectangle(cornerRadius: 18)
                    .fill(.white.opacity(0.72))
                    .frame(height: 112)
                RoundedRectangle(cornerRadius: 18)
                    .fill(.white.opacity(0.72))
                    .frame(height: 220)
            }
            .redacted(reason: .placeholder)
            .padding(ScenicPromotionLayout.screenEdgePadding)
            .frame(maxWidth: .infinity, alignment: .top)
        }
    }
}

#if DEBUG
#Preview("加载中") {
    ZStack {
        ScenicPromotionSkyBackground().ignoresSafeArea()
        ScenicPromotionLoadingView()
    }
}
#endif
