import 'package:flutter/material.dart';

import '../../../../../../../utils/translations_delegate_base_utils.dart';
import '../../../../../../../widgets/shared/app_texts_widget.dart';
import '../../../../../../../widgets/shared/buttons/app_buttons_widget.dart';

class ListOfComplaintsItem extends StatelessWidget {
  final String name;
  final String createdBy;
  final String createdAt;
  final VoidCallback onSendClick;

  const ListOfComplaintsItem(
      {super.key,
      required this.name,
      required this.createdBy,
      required this.createdAt,
      required this.onSendClick});

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Expanded(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisSize: MainAxisSize.max,
            children: [
              Text(
                name,
                textAlign: TextAlign.start,
                style: TextStyle(
                    fontWeight: FontWeight.w600,
                    fontSize: 16,
                    color: Color(0xFF2E303A),
                    overflow: TextOverflow.clip),
              ),
              SizedBox(
                height: 4,
              ),
              Row(
                children: [
                  Text(TranslationBase.of(context).createdBy,
                      textAlign: TextAlign.start,
                      style: TextStyle(
                        fontWeight: FontWeight.w400,
                        fontSize: 15,
                        color: Color(0xFF2E303A),
                      )),
                  SizedBox(
                    width: 4,
                  ),
                  Expanded(
                    child: Text(createdBy,
                        textAlign: TextAlign.start,
                        style: TextStyle(
                          fontWeight: FontWeight.w400,
                          fontSize: 12,
                          overflow: TextOverflow.ellipsis,
                          color: Color(0xFF2E303A),
                        )),
                  ),
                ],
              ),
              // Row(
              //   children: [
              //     Expanded(
              //       child: AppText(
              //         TranslationBase.of(context).createdBy,
              //         fontWeight: FontWeight.w400,
              //         fontSize: 15,
              //         color: Color(0xFF2E303A),
              //         textAlign: TextAlign.start,
              //       ),
              //     ),
              //     SizedBox(
              //       width: 4,
              //     ),
              //     AppText(
              //       createdBy,
              //       fontWeight: FontWeight.w400,
              //       fontSize: 12,
              //       textAlign: TextAlign.start,
              //       textOverflow: TextOverflow.ellipsis,
              //       color: Color(0xFF2E303A),
              //     )
              //   ],
              // ),
              SizedBox(
                height: 5,
              ),
              Row(
                children: [
                  Text(TranslationBase.of(context).createdOn,
                      textAlign: TextAlign.start,
                      style: TextStyle(
                        fontWeight: FontWeight.w400,
                        fontSize: 15,
                        color: Color(0xFF2E303A),
                      )),
                  SizedBox(
                    width: 4,
                  ),
                  Expanded(
                    child: Text(createdAt,
                        textAlign: TextAlign.start,
                        style: TextStyle(
                          fontWeight: FontWeight.w400,
                          fontSize: 12,
                          overflow: TextOverflow.ellipsis,
                          color: Color(0xFF2E303A),
                        )),
                  ),
                ],
              )
            ],
          ),
        ),
        SizedBox(
          width: 77,
          height: 27,
          child: AppButton(
            title: TranslationBase.of(context).select,
            hPadding: 8,
            color: Color(0xFFD02127),
            fontColor: Colors.white,
            onPressed: () {
              onSendClick();
            },
          ),
        ),
      ],
    );
  }
}
