import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:telnow_mobile_new/src/layouts/mobile/app_mobile.dart';
import 'package:telnow_mobile_new/src/layouts/web/app_web.dart';
import 'package:telnow_mobile_new/src/layouts/web/menu_account.dart';
import 'package:telnow_mobile_new/src/layouts/web/menu_history.dart';
import 'package:telnow_mobile_new/src/layouts/web/menu_home.dart';
import 'package:telnow_mobile_new/src/utils/U.dart';

import '../../cubit/menu_history_cubit.dart';

@RoutePage()
class AppResponsive extends StatelessWidget {
  const AppResponsive({super.key});

  @override
  Widget build(BuildContext context) {
    return U.webView(context) ? WebAppPage(AutoRouter()) : MobAppPage(AutoRouter());
  }
}

@RoutePage()
class HomeResponsive extends StatelessWidget {
  const HomeResponsive({super.key});

  @override
  Widget build(BuildContext context) {
    return U.webView(context) ? WebHomePage() : MobMenuTemplate();
  }
}

@RoutePage()
class HistoryResponsive extends StatelessWidget {
  const HistoryResponsive({super.key});

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => MenuHistoryCubit(),
      child: U.webView(context) ? WebHistoryPage() : MobMenuTemplate(),
    );
  }
}

@RoutePage()
class AccountResponsive extends StatelessWidget {
  const AccountResponsive({super.key});

  @override
  Widget build(BuildContext context) {
    return U.webView(context) ? WebAccountPage() : MobMenuTemplate();
  }
}



