import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:niogu_app/core/providers/app_provider.dart';
import 'package:niogu_app/features/auth/data/datasource/auth_remote_datasource_impl.dart';
import 'package:niogu_app/features/auth/data/repositories/auth_repository_impl.dart';
import 'package:niogu_app/features/auth/domain/repositories/i_auth_repository.dart';
import 'package:niogu_app/features/auth/presentation/controllers/auth_controller.dart';

final authRemoteDataSourceProvider =
    Provider.autoDispose<IAuthRemoteDatasource>((ref) {
      final dio = ref.watch(dioProvider);
      return AuthRemoteDatasourceImpl(dio);
    });

final authRepositoryProvider = Provider.autoDispose<IAuthRepository>((ref) {
  final datasource = ref.watch(authRemoteDataSourceProvider);
  return AuthRepositoryImpl(datasource);
});

final authControllerProvider =
    AsyncNotifierProvider.autoDispose<AuthController, void>(AuthController.new);
