import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'package:staff_attire/staff_attire.dart';
import 'package:staff_availability/staff_availability.dart';
import 'package:staff_bank_account/staff_bank_account.dart';
import 'package:staff_certificates/staff_certificates.dart';
import 'package:staff_clock_in/staff_clock_in.dart';
import 'package:staff_documents/staff_documents.dart';
import 'package:staff_emergency_contact/staff_emergency_contact.dart';
import 'package:staff_home/staff_home.dart';
import 'package:staff_main/src/presentation/blocs/staff_main_cubit.dart';
import 'package:staff_main/src/presentation/pages/staff_main_page.dart';
import 'package:staff_payments/staff_payements.dart';
import 'package:staff_profile/staff_profile.dart';
import 'package:staff_profile_experience/staff_profile_experience.dart';
import 'package:staff_profile_info/staff_profile_info.dart';
import 'package:staff_shifts/staff_shifts.dart';
import 'package:staff_tax_forms/staff_tax_forms.dart';
import 'package:staff_time_card/staff_time_card.dart';

class StaffMainModule extends Module {
  @override
  void binds(Injector i) {
    i.addSingleton(StaffMainCubit.new);
  }

  @override
  void routes(RouteManager r) {
    r.child(
      '/',
      child: (BuildContext context) => const StaffMainPage(),
      children: <ParallelRoute<dynamic>>[
        ModuleRoute<dynamic>(
          StaffPaths.childRoute(StaffPaths.main, StaffPaths.shifts),
          module: StaffShiftsModule(),
        ),
        ModuleRoute<dynamic>(
          StaffPaths.childRoute(StaffPaths.main, StaffPaths.payments),
          module: StaffPaymentsModule(),
        ),
        ModuleRoute<dynamic>(
          StaffPaths.childRoute(StaffPaths.main, StaffPaths.home),
          module: StaffHomeModule(),
        ),
        ModuleRoute<dynamic>(
          StaffPaths.childRoute(StaffPaths.main, StaffPaths.clockIn),
          module: StaffClockInModule(),
        ),
        ModuleRoute<dynamic>(
          StaffPaths.childRoute(StaffPaths.main, StaffPaths.profile),
          module: StaffProfileModule(),
        ),
      ],
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.onboardingPersonalInfo).replaceFirst('/personal-info', ''),
      module: StaffProfileInfoModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.emergencyContact),
      module: StaffEmergencyContactModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.experience),
      module: StaffProfileExperienceModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.attire),
      module: StaffAttireModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.bankAccount),
      module: StaffBankAccountModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.taxForms),
      module: StaffTaxFormsModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.documents),
      module: StaffDocumentsModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.certificates),
      module: StaffCertificatesModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.timeCard),
      module: StaffTimeCardModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.availability),
      module: StaffAvailabilityModule(),
    );
    r.module(
      StaffPaths.childRoute(StaffPaths.main, StaffPaths.shiftDetailsRoute),
      module: ShiftDetailsModule(),
    );
  }
}
