//
//  NameView.swift
//  Werkout_ios
//
//  Created by Trey Tartt on 6/16/24.
//

import SwiftUI

struct NameView: View {
    @ObservedObject var userStore = UserStore.shared
    
    var body: some View {
        if let registeredUser = userStore.registeredUser {
            if let nickName = registeredUser.nickName {
                Text(nickName)
                    .font(.title)
            }
            
            HStack {
                Text(registeredUser.firstName ?? "-")
                Text(registeredUser.lastName ?? "-")
            }
            
            if let email = registeredUser.email {
                Text(email)
            }
        }
    }
}

#Preview {
    NameView()
}
