import 'package:chat/middleware/auth_middleware.dart';
import 'package:chat/views/auth/create/index_page.dart';
import 'package:chat/views/auth/create/verify_page.dart';
import 'package:chat/views/auth/import/index_page.dart';
import 'package:chat/views/auth/index/index_page.dart';
import 'package:get/get.dart';

abstract class AuthRoutes {
  /// 身份验证页面
  static const String index = '/auth';
  static const String create = '/auth/create';
  static const String createVerify = '/auth/create/verify';
  static const String import = '/auth/import';

  static GetPage router = GetPage(
    name: AuthRoutes.index,
    middlewares: [
      EnsureNotAuthMiddleware(),
    ],
    page: () => const AuthPage(),
    children: [
      GetPage(
        name: '/create',
        page: () => const AuthCreatePage(),
        children: [
          GetPage(
            name: '/verify',
            page: () => const AuthCreateVerifyPage(),
          ),
        ],
      ),
      GetPage(
        name: '/import',
        page: () => const AuthImportPage(),
      ),
    ],
  );
}
