import 'package:flutter/material.dart';

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

import 'package:pweb/pages/payout_page/send/widgets/recipient_details_card.dart';
import 'package:pweb/utils/dimensions.dart';
import 'package:pweb/models/state/visibility.dart';


class PaymentPageRecipientSection extends StatelessWidget {
  final AppDimensions dimensions;
  final Recipient? recipient;
  final RecipientsProvider recipientProvider;
  final String searchQuery;
  final List<Recipient> filteredRecipients;
  final TextEditingController searchController;
  final FocusNode searchFocusNode;
  final ValueChanged<String> onSearchChanged;
  final ValueChanged<Recipient> onRecipientSelected;
  final VoidCallback onRecipientCleared;
  final VoidCallback onAddRecipient;
  final VoidCallback onAddPaymentMethod;
  final VisibilityState paymentDetailsVisibility;
  final VoidCallback onTogglePaymentDetails;

  const PaymentPageRecipientSection({
    super.key,
    required this.dimensions,
    required this.recipient,
    required this.recipientProvider,
    required this.searchQuery,
    required this.filteredRecipients,
    required this.searchController,
    required this.searchFocusNode,
    required this.onSearchChanged,
    required this.onRecipientSelected,
    required this.onRecipientCleared,
    required this.onAddRecipient,
    required this.onAddPaymentMethod,
    required this.paymentDetailsVisibility,
    required this.onTogglePaymentDetails,
  });

  @override
  Widget build(BuildContext context) {
    return PaymentRecipientDetailsCard(
      dimensions: dimensions,
      recipient: recipient,
      recipientProvider: recipientProvider,
      searchQuery: searchQuery,
      filteredRecipients: filteredRecipients,
      searchController: searchController,
      searchFocusNode: searchFocusNode,
      onSearchChanged: onSearchChanged,
      onRecipientSelected: onRecipientSelected,
      onRecipientCleared: onRecipientCleared,
      onAddRecipient: onAddRecipient,
      onAddPaymentMethod: onAddPaymentMethod,
      paymentDetailsVisibility: paymentDetailsVisibility,
      onTogglePaymentDetails: onTogglePaymentDetails,
    );
  }
}
