//
//  ProfileView.swift
//  Comedores Sociales
//
//  Created by Hector Carrion on 12/16/20.
//

import SwiftUI

struct ProfileView: View {
    
    @EnvironmentObject var profileVM: ProfileViewModel
    
    var body: some View {
            VStack(alignment: .leading, spacing: 20) {
                if profileVM.response == .unfetched {
                    ProfileSummary(profile: Profile.default)
                } else if profileVM.response == .success {
                    ProfileSummary(profile: profileVM.profile)
                }
            }
            .padding()
        }
}

struct ProfileView_Previews: PreviewProvider {
    static var previews: some View {
        ProfileView()
    }
}
