import 'package:chat/middleware/auth_middleware.dart';
import 'package:chat/views/conversation/index_page.dart';
import 'package:chat/views/conversation/info/group_page.dart';
import 'package:chat/views/conversation/info/private_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

abstract class ConversationRoutes {
  /// 身份验证页面
  static const String index = '/conversation';

  static const String infoGroup = '/conversation/info/group';
  static const String infoPrivate = '/conversation/info/private';

  static GetPage router = GetPage(
    name: ConversationRoutes.index,
    middlewares: [
      EnsureAuthMiddleware(),
    ],
    page: () => const ConversationPage(),
    children: [
      GetPage(
        name: '/info',
        page: () => Container(),
        children: [
          GetPage(
            name: '/private',
            page: () => const ConversationInfoPrivatePage(),
          ),
          GetPage(
            name: '/group',
            page: () => const ConversationInfoGroupPage(),
          ),
        ],
      ),
    ],
  );
}
