import 'package:dialer/features/contacts/contact_state.dart';
import 'package:dialer/features/contacts/widgets/alphabet_scroll_page.dart';
import 'package:flutter/material.dart';
import 'package:dialer/widgets/loading_indicator.dart';

class FavoritesPage extends StatefulWidget {
  const FavoritesPage({super.key});

  @override
  _FavoritesPageState createState() => _FavoritesPageState();
}

class _FavoritesPageState extends State<FavoritesPage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final contactState = ContactState.of(context);
    return Scaffold(
      body: contactState.loading
          ? const LoadingIndicatorWidget()
          : AlphabetScrollPage(
              scrollOffset: contactState.scrollOffset,
              contacts:
                  contactState.favoriteContacts, // Use only favorites here
            ),
    );
  }
}
