import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/utils/currency.dart';

import 'package:pweb/pages/dashboard/payouts/summary/fee.dart';
import 'package:pweb/pages/dashboard/payouts/summary/recipient_receives.dart';
import 'package:pweb/pages/dashboard/payouts/summary/sent_amount.dart';
import 'package:pweb/pages/dashboard/payouts/summary/total.dart';
import 'package:pshared/provider/payment/wallets.dart';


class PaymentSummary extends StatelessWidget {
  final double spacing;

  const PaymentSummary({super.key, required this.spacing});

  @override
  Widget build(BuildContext context) => Align(
    alignment: Alignment.center,
    child: Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [
        PaymentSentAmountRow(currency: currencyStringToCode(context.read<WalletsProvider>().selectedWallet?.tokenSymbol ?? 'USDT')),
        const PaymentFeeRow(),
        const PaymentRecipientReceivesRow(),
        SizedBox(height: spacing),
        const PaymentTotalRow(),
      ],
    ),
  );
}
