//
//  TournamentDatePickerView.swift
//  Padel Tournament
//
//  Created by Razmig Sarkissian on 05/10/2023.
//

import SwiftUI

struct TournamentDatePickerView: View {
    @Environment(Tournament.self) private var tournament: Tournament

    var body: some View {
        @Bindable var tournament = tournament
        DatePicker(selection: $tournament.startDate) {
            Text(tournament.startDate.formatted(.dateTime.weekday(.wide)).capitalized)
                .font(.headline)
        }
        .datePickerStyle(.compact)
    }
}
