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

import SwiftUI

struct Logoutview: View {
    @ObservedObject var userStore = UserStore.shared
    
    var body: some View {
        HStack {
            Button("Logout", action: {
                userStore.logout()
            })
            .frame(maxWidth: .infinity, alignment: .center)
            .frame(height: 44)
            .foregroundColor(.white)
            .background(.red)
            .cornerRadius(8)
            .padding()
            .frame(maxWidth: .infinity)
            
            Button(action: {
                userStore.refreshUserData()
            }, label: {
                Image(systemName: "arrow.triangle.2.circlepath")
            })
            .frame(width: 44, height: 44)
            .foregroundColor(.white)
            .background(.green)
            .cornerRadius(8)
            .padding()
            .frame(maxWidth: .infinity)
        }
    }
}

#Preview {
    Logoutview()
}
