import 'package:chat/middleware/auth_middleware.dart';
import 'package:chat/views/moments/detail/detail_page.dart';
import 'package:chat/views/moments/index/index_page.dart';
import 'package:chat/views/moments/publish/preview_page.dart';
import 'package:chat/views/moments/publish/index_page.dart';
import 'package:chat/views/moments/user/index_page.dart';
import 'package:get/get.dart';

abstract class MomentsRoutes {
  static const String index = '/moments';

  static const String publish = '/moments/publish';
  static const String publishPreview = '/moments/publish/preview';

  static const String detail = '/moments/detail';

  static const String user = '/moments/user';

  static GetPage router = GetPage(
    name: MomentsRoutes.index,
    middlewares: [
      EnsureAuthMiddleware(),
    ],
    page: () => const MomentsPage(),
    children: [
      GetPage(
        name: '/publish',
        page: () => const MomentsPublishPage(),
        children: [
          GetPage(
            name: '/preview',
            page: () => const PublishPreviewPage(),
          ),
        ],
      ),
      GetPage(
        name: '/detail',
        page: () => const MomentDetailPage(),
      ),
      GetPage(
        name: '/user',
        page: () => const MomentsUserPage(),
      ),
    ],
  );
}
