//
//  ProfileComplimentListView.swift
//
//
//  Created by Victor on 31/07/2024.
//

import SwiftUI

private struct Compliment: Identifiable {
    let id: Int
}

struct ProfileComplimentListView: View {
    private let compliments: [Compliment] = [
        Compliment(id: 1),
        Compliment(id: 2),
        Compliment(id: 3),
        Compliment(id: 4),
        Compliment(id: 5)
    ]

    var body: some View {
        VStack(alignment: .leading) {
            SQText("Compliments reçus", size: 18, font: .bold)
                .padding(.horizontal)
            VStack(alignment: .center, spacing: 16) {
                VStack(alignment: .leading) {
                    ForEach(Array(stride(from: 0, to: compliments.count, by: 3)), id: \.self) { index in
                        HStack(spacing: 24) {
                            ForEach(index ..< min(index + 3, compliments.count), id: \.self) { _ in
                                ComplimentView()
                            }
                        }
                    }
                }
                
                Rectangle()
                    .frame(height: 16)
                    .foregroundColor(Color.sqNeutral(10))
            }
        }
    }
}

#Preview {
    ProfileComplimentListView()
}
