import 'package:rasadyar_app/presentation/pages/splash/logic.dart';
import 'package:rasadyar_app/presentation/pages/splash/view.dart';
import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart';
import 'package:rasadyar_auth/auth.dart';
import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart';
import 'package:rasadyar_auth/presentation/routes/pages.dart';
import 'package:rasadyar_chicken/chicken.dart';
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_inspection/inspection.dart';
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';

part 'app_paths.dart';

sealed class AppPages {
  AppPages._();

  static const String initRoutes = AppPaths.splash;
  static const String initDesignSystem = AppPaths.systemDesignPage;

  static List<GetPage> pages = [
    GetPage(name: AppPaths.systemDesignPage, page: () => SystemDesignPage()),
    GetPage(
      name: AppPaths.splash,
      page: () => SplashPage(),
      binding: BindingsBuilder.put(() => SplashLogic()),
    ),

    ...InspectionPages.pages,
    ...AuthPages.pages,
    ...LiveStockPages.pages,
    ...ChickenPages.pages,
  ];
}

String getTargetPage(Module? value) {
  eLog('getTargetPage: $value');
  switch (value) {
    case Module.inspection:
      return InspectionRoutes.inspection;
    case Module.liveStocks:
      return LiveStockRoutes.init;
    case Module.chicken:
      return ChickenRoutes.init;
    default:
      return ChickenRoutes.init;
  }
}
