//
//  LoadingTripsView.swift
//  SportsTime
//
//  Loading state for suggested trips carousel using skeleton placeholders.
//

import SwiftUI

struct LoadingTripsView: View {
    let message: String
    @Environment(\.colorScheme) private var colorScheme

    var body: some View {
        VStack(alignment: .leading, spacing: Theme.Spacing.sm) {
            // Header
            HStack {
                Text("Featured Trips")
                    .font(.title2)
                    .foregroundStyle(Theme.textPrimary(colorScheme))
                Spacer()
            }

            // Loading indicator with message
            LoadingSpinner(size: .small, label: message)
                .padding(.vertical, Theme.Spacing.xs)

            // Placeholder cards
            ScrollView(.horizontal, showsIndicators: false) {
                HStack(spacing: Theme.Spacing.md) {
                    ForEach(0..<3, id: \.self) { _ in
                        LoadingPlaceholder.card
                    }
                }
            }
        }
    }
}

#Preview {
    VStack {
        LoadingTripsView(message: "Loading trips...")
            .padding()
    }
    .themedBackground()
}
