import 'package:flutter/material.dart';

import 'package:pshared/models/payment/methods/data.dart';
import 'package:pshared/models/recipient/payment_method_draft.dart';
import 'package:pweb/pages/address_book/form/widgets/payment_methods/panel/panel.dart';

import 'package:pweb/pages/payout_page/send/widgets/payment_info/header.dart';
import 'package:pweb/models/state/control_state.dart';
import 'package:pweb/models/state/visibility.dart';
import 'package:pweb/utils/dimensions.dart';


class PaymentInfoManualDetailsSection extends StatelessWidget {
  final AppDimensions dimensions;
  final String title;
  final VisibilityState titleVisibility;
  final PaymentMethodData data;

  const PaymentInfoManualDetailsSection({
    super.key,
    required this.dimensions,
    required this.title,
    required this.titleVisibility,
    required this.data,
  });

  @override
  Widget build(BuildContext context) {
    final entry = RecipientMethodDraft(type: data.type, data: data);

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        PaymentInfoHeader(
          dimensions: dimensions,
          title: title,
          visibility: titleVisibility,
        ),
        PaymentMethodPanel(
          selectedType: data.type,
          selectedIndex: 0,
          entries: [entry],
          editState: ControlState.disabled,
          deleteVisibility: VisibilityState.hidden,
        ),
      ],
    );
  }
}
