import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'package:staff_home/src/data/repositories/home_repository_impl.dart';
import 'package:staff_home/src/domain/repositories/home_repository.dart';
import 'package:staff_home/src/presentation/blocs/home_cubit.dart';
import 'package:staff_home/src/presentation/pages/worker_home_page.dart';

/// The module for the staff home feature.
///
/// This module provides dependency injection bindings for the home feature
/// following Clean Architecture principles. It injects the repository
/// implementation and state management components.
class StaffHomeModule extends Module {
  @override
  void binds(Injector i) {
    // Repository
    i.addLazySingleton<HomeRepository>(() => HomeRepositoryImpl());

    // Presentation layer - Cubit
    i.addSingleton(HomeCubit.new);
  }

  @override
  void routes(RouteManager r) {
    r.child(
      StaffPaths.childRoute(StaffPaths.home, StaffPaths.home),
      child: (BuildContext context) => const WorkerHomePage(),
    );
  }
}
