// swiftlint:disable all
/*
 This file contains full state for xcode preview purposes.
 Please, change this file only if you update state during development
 (if you need something different in state - just change it in preview locally)

 Will work only on debug builds
 */

#if DEBUG
import SwiftUI

extension PreviewProvider {
    private static func getAccountsState() -> AccountsState {
        AccountsState()
    }

    static func showPreview(stateConfig: (inout AppState) -> Void) -> some View {
        // create and pre setup state
        var state = AppState()
        state.accountsState = getAccountsState()

        // update state for certain preview
        stateConfig(&state)

        // return view
        return BaseNavigationView()
            .environmentObject(AppStore.init(
                initialState: state,
                reducer: AppState.reducer
            ))
    }
}
#endif
