import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:niogu_ecommerce_v1/core/providers/app_provider.dart';
import 'package:niogu_ecommerce_v1/features/product/data/datasource/product_datasource_remote_impl.dart';
import 'package:niogu_ecommerce_v1/features/product/data/repositories/product_repository_impl.dart';
import 'package:niogu_ecommerce_v1/features/product/domain/repositories/i_product_repository.dart';

final productRemoteDatasourceProvider =
    Provider.autoDispose<IProductDatasourceRemote>((ref) {
      final dio = ref.watch(dioProvider);

      return ProductDatasourceRemoteImpl(dio);
    });

final productRepositoryProvider = Provider.autoDispose<IProductRepository>((
  ref,
) {
  final productRemoteDatasource = ref.watch(productRemoteDatasourceProvider);

  return ProductRepositoryImpl(productRemoteDatasource);
});
