import 'package:fluent_ui/fluent_ui.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:momo/fluent/login.dart';
import 'package:momo/fluent/router.dart';
import 'package:momo/provider/token.dart';

class MyFluentApp extends ConsumerWidget {
  const MyFluentApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final String token = ref.watch(tokenProvider);
    return token.isNotEmpty
        ? FluentApp.router(
            routeInformationParser:
                MyFluentRouterConfig.router.routeInformationParser,
            routerDelegate: MyFluentRouterConfig.router.routerDelegate,
            color: Colors.blue,
          )
        : FluentApp(
            color: Colors.blue,
            home: LoginPage(),
          );
  }
}
