//
//  ScoreBoardView.swift
//  DouShouQi_App
//
//  Created by Rémi REGNAULT on 21/05/2024.
//

import SwiftUI
import DouShouQiModel

struct ScoreBoardView: View {
    var body: some View {
        VStack {
            HStack {
                TitlePageFrame(Text: "Score Board", ImageWidth: 200, ImageHeight: 200)
            }
            
            VStack {
                HStack {
                    Text("Rank")
                        .font(.headline)
                        .frame(width: 50, alignment: .trailing)
                    
                    Text("Name")
                    
                    Spacer()
                    
                    Text("Wins")
                        .frame(width: 55, alignment: .trailing)
                    
                    Text("Looses")
                        .frame(width: 55, alignment: .trailing)
                    
                }
                .padding(10)
                
                HStack {
                    Rectangle()
                        .frame(height: 2)
                }
                
                PlayerScoreResumeFrame(Name: "Nathan Verdier", Rank: 1, Wins: 19, Looses: 15)
                PlayerScoreResumeFrame(Name: "Rayhan Hassou", Rank: 2, Wins: 17, Looses: 17)
                PlayerScoreResumeFrame(Name: "Rémi Regnault", Rank: 3, Wins: 15, Looses: 19)
            }
            
            Spacer()
        }
        .padding(10)
    }
}

struct ScoreBoardView_Previews: PreviewProvider {
    static var previews: some View {
        ScoreBoardView()
    }
}
