import 'package:flutter/material.dart';

import 'package:pweb/pages/dashboard/payouts/form.dart';
import 'package:pweb/pages/payout_page/send/widgets/send_button.dart';
import 'package:pweb/pages/payout_page/send/widgets/section/card.dart';
import 'package:pweb/utils/dimensions.dart';
import 'package:pweb/widgets/cooldown_hint.dart';
import 'package:pweb/models/state/control_state.dart';


class PaymentSendCard extends StatelessWidget {
  final AppDimensions dimensions;
  final ControlState sendState;
  final int cooldownRemainingSeconds;
  final VoidCallback onSend;

  const PaymentSendCard({
    super.key,
    required this.dimensions,
    required this.sendState,
    required this.cooldownRemainingSeconds,
    required this.onSend,
  });

  @override
  Widget build(BuildContext context) {
    return PaymentSectionCard(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const PaymentFormWidget(),
          SizedBox(height: dimensions.paddingXLarge),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SendButton(
                onPressed: onSend,
                state: sendState,
              ),
              if (sendState == ControlState.disabled &&
                  cooldownRemainingSeconds > 0) ...[
                SizedBox(height: dimensions.paddingSmall),
                CooldownHint(seconds: cooldownRemainingSeconds),
              ],
            ],
          ),
        ],
      ),
    );
  }
}
