//
//  PlayerListView.swift
//  WtaTennis
//
//  Created by Johan LACHENAL on 14/05/2024.
//

import SwiftUI

struct PlayerListView: View {
    @ObservedObject var viewModel: PlayerViewModel

    var body: some View {
        NavigationStack {
            List(viewModel.players, id: \.id) { player in
                PlayerProfileView(player: player)
                    .padding(.vertical, 5)
            }
            .navigationTitle("Top Players")
        }
    }
}


struct PlayerListView_Previews: PreviewProvider {
    static var previews: some View {
        PlayerListView(viewModel: PlayerViewModel())
    }
}
