import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/provider/payment/amount.dart';

import 'package:pweb/controllers/payments/comment_field.dart';
import 'package:pweb/pages/dashboard/payouts/comment/field.dart';


class PaymentCommentWidget extends StatelessWidget {
  const PaymentCommentWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProxyProvider<
      PaymentAmountProvider,
      PaymentCommentFieldController
    >(
      create: (ctx) {
        final initialComment = ctx.read<PaymentAmountProvider>().comment;
        return PaymentCommentFieldController(initialComment: initialComment);
      },
      update: (ctx, amountProvider, controller) {
        controller!.update(amountProvider);
        return controller;
      },
      child: const PaymentCommentField(),
    );
  }
}
