import 'package:flutter/material.dart';

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

import 'package:pweb/pages/address_book/form/widgets/payment_methods/selector_row.dart';
import 'package:pweb/pages/payout_page/send/widgets/payment_info/header.dart';
import 'package:pweb/models/state/visibility.dart';
import 'package:pweb/utils/dimensions.dart';
import 'package:pweb/utils/payment/availability.dart';


class PaymentInfoNoMethodsSection extends StatelessWidget {
  final AppDimensions dimensions;
  final String title;
  final VisibilityState titleVisibility;
  final String emptyMessage;
  final List<PaymentType> types;
  final VoidCallback? onAddMethod;

  const PaymentInfoNoMethodsSection({
    super.key,
    required this.dimensions,
    required this.title,
    required this.titleVisibility,
    required this.emptyMessage,
    required this.types,
    required this.onAddMethod,
  });

  @override
  Widget build(BuildContext context) {
    final fallbackType = types.isNotEmpty ? types.first : PaymentType.bankAccount;

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        PaymentInfoHeader(
          dimensions: dimensions,
          title: title,
          visibility: titleVisibility,
        ),
        Text(emptyMessage),
        if (onAddMethod != null) ...[
          SizedBox(height: dimensions.paddingMedium),
          PaymentMethodSelectorRow(
            types: types,
            selectedType: fallbackType,
            selectedIndex: null,
            methods: const {},
            onSelected: (_, _) {},
            onAddPressed: onAddMethod,
            disabledTypes: disabledPaymentTypes,
          ),
        ],
      ],
    );
  }
}
