import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/models/payment/wallet.dart';
import 'package:pshared/provider/payment/wallets.dart';

import 'package:pweb/utils/payment/dropdown.dart';


class PaymentMethodSelector extends StatelessWidget {
  final ValueChanged<Wallet> onMethodChanged;

  const PaymentMethodSelector({
    super.key,
    required this.onMethodChanged,
  });

  @override
  Widget build(BuildContext context) => Consumer<WalletsProvider>(
        builder: (context, provider, _) => PaymentMethodDropdown(
          methods: provider.wallets,
          selectedMethod: provider.selectedWallet,
          onChanged: onMethodChanged,
        ),
      );
}
