import Foundation
import SwiftUI

struct StartScreen: View {
    @EnvironmentObject var store: AppStore
    
    var body: some View {
        VStack {
            Spacer()
            Image.logo
                .resizable()
                .aspectRatio(contentMode: .fit)
                .frame(width: 200, height: 200)
            Spacer()
        }
            .ignoresSafeArea()
            .background(Color.Main.backgroundLight)
            .onLoad {
                store.dispatch(.accountsAction(.getAll))
            }
    }
}

#if DEBUG
struct StartScreen_Previews: PreviewProvider {
    static var previews: some View {
        showPreview(stateConfig: { _ in })
    }
}
#endif
