import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pweb/controllers/payments/comment_field.dart';

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


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

  @override
  Widget build(BuildContext context) {
    final loc = AppLocalizations.of(context)!;
    final controller = context.watch<PaymentCommentFieldController>();

    return TextField(
      controller: controller.textController,
      decoration: InputDecoration(
        labelText: '${loc.comment} (${loc.optional})',
        border: const OutlineInputBorder(),
      ),
      onChanged: controller.handleChanged,
    );
  }
}
