import 'package:flutter/material.dart';

import 'package:pweb/controllers/payouts/multiple_payouts.dart';
import 'package:pweb/models/dashboard/summary_values.dart';
import 'package:pweb/pages/dashboard/payouts/summary/widget.dart';
import 'package:pweb/utils/money_display.dart';

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


class SourceQuoteSummary extends StatelessWidget {
  const SourceQuoteSummary({
    super.key,
    required this.controller,
    required this.spacing,
  });

  final MultiplePayoutsController controller;
  final double spacing;

  @override
  Widget build(BuildContext context) {
    final l10n = AppLocalizations.of(context)!;
    return PaymentSummary(
      spacing: spacing,
      values: PaymentSummaryValues(
        fee: controller.aggregateFeeAmount == null
            ? l10n.noFee
            : formatMoneyUi(context, controller.aggregateFeeAmount),
        recipientReceives: formatMoneyUi(
          context,
          controller.aggregateSettlementAmount,
        ),
        total: formatMoneyUi(context, controller.aggregateDebitAmount),
      ),
    );
  }
}
