import 'package:flutter/material.dart';

import 'package:pshared/models/recipient/recipient.dart';

import 'package:pweb/pages/dashboard/payouts/single/address_book/long_list/item.dart';


class LongListAddressBookPayout extends StatelessWidget {
  final List<Recipient> filteredRecipients;
  final ValueChanged<Recipient>? onSelected;

  const LongListAddressBookPayout({
    super.key,
    required this.filteredRecipients,
     this.onSelected,
  });

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: filteredRecipients.length,
      itemBuilder: (context, index) {
        final recipient = filteredRecipients[index];
        return RecipientItem(
          recipient: recipient,
          onTap: () => onSelected!(recipient),
        );
      },
    );
  }
}
