class IntentImportInformationPresenter extends BaseViperPresenter<IntentImportInformationView, IntentImportInformationInteractor> {

    @Override
    public void subscribe() {
        compositeDisposable.add(intentImportProvider.getIntentMaybe()
                .flatMapObservable(interactor::process)
                .observeOn(AndroidSchedulers.mainThread())
                .filter(uiIndicator -> uiIndicator.getState() == UiIndicator.State.Success)
                .subscribe(uiIndicator -> {
                            final IntentImportResult result = uiIndicator.getData().get();
                            if (result.getFileType() == FileType.Smr) {
                                navigationHandler.showDialog(ImportLocalBackupDialogFragment.newInstance(result.getUri()));
                            } else {
                                view.presentIntentImportInformation(result.getFileType());
                            }
                        },
                        throwable -> {
                            Logger.error(IntentImportInformationPresenter.this, "Failed to process file import", throwable);
                            view.presentIntentImportFatalError();
                        }));
    }

    @Inject public  IntentImportInformationPresenter(@NonNull IntentImportInformationView view, @NonNull IntentImportInformationInteractor interactor,
                                            @NonNull IntentImportProvider intentImportProvider,
                                            @NonNull NavigationHandler<SmartReceiptsActivity> navigationHandler);

}