import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:krow/core/presentation/widgets/ui_kit/kw_dropdown.dart';
import 'package:krow/core/presentation/widgets/ui_kit/kw_input.dart';
import 'package:krow/features/earning/domain/entities/earning_dispute_info.dart';

class DisputeFormWidget extends StatelessWidget {
  const DisputeFormWidget({super.key, required this.disputeInfo});

  final EarningDisputeInfo disputeInfo;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        KwDropdown<String>(
          title: 'reason'.tr(),
          hintText: 'select_reason_from_list'.tr(),
          horizontalPadding: 24,
          items: [
            for (final reason in _disputeReasonsData)
              KwDropDownItem(data: reason, title: reason),
          ],
          onSelected: (reason) => disputeInfo.reason = reason,
        ),
        const Gap(8),
        KwTextInput(
          title: 'additional_reasons'.tr(),
          minHeight: 114,
          controller: TextEditingController(),
          onChanged: (details) => disputeInfo.details = details,
        ),
      ],
    );
  }
}

final _disputeReasonsData = [
  'incorrect_hours'.tr(),
  'incorrect_charges'.tr(),
  'other'.tr()
];
