import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/controllers/balance_mask/wallets.dart';
import 'package:pshared/models/payment/type.dart';

import 'package:pweb/app/router/payout_routes.dart';
import 'package:pweb/widgets/sidebar/destinations.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class SendPayoutButton extends StatelessWidget {
  const SendPayoutButton({super.key});

  @override
  Widget build(BuildContext context) {
    final loc = AppLocalizations.of(context)!;
    return ElevatedButton(
      style: ElevatedButton.styleFrom(
        shadowColor: null,
        elevation: 0,
      ),
      onPressed: () {
        final wallets = context.read<WalletsController>();
        final wallet = wallets.selectedWallet;
        
        if (wallet != null) {
          context.pushToPayment(
            paymentType: PaymentType.wallet,
            returnTo: PayoutDestination.editwallet,
          );
        }
      },
      child: Text(loc.payoutNavSendPayout),
    );
  }
}
