//
//  AccountView.swift
//  PadelClub
//
//  Created by Laurent Morvillier on 21/02/2024.
//

import SwiftUI
import LeStorage

struct AccountView: View {
    
    var user: User
    var handler: () -> ()
    
    var body: some View {
        Form {
            NavigationLink("Changer de mot de passe") {
                ChangePasswordView()
            }
            Button("Déconnexion") {
                DataStore.shared.disconnect()
                handler()
            }
        }.navigationTitle(user.username)
    }
}

//#Preview {
//    AccountView(user: User(username: "coco", email: ",mail", firstName: "first", lastName: "last", phone: "44444", country: "US")) {
//        
//    }
//}
