import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/models/requests_models/request_model.dart';
import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';

class RequestStatusChip extends StatelessWidget {
  final RequestModel request;

  const RequestStatusChip(this.request, {super.key});

  @override
  Widget build(BuildContext context) {
    return request.requestStatusName
        .toText(
          fontSize: 8,
          color: Colors.white,
        )
        .toContainer(
          padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
          backgroundColor: request.requestStatus == RequestStatusEnum.pending
              ? MyColors.adPendingStatusColor
              : request.requestStatus == RequestStatusEnum.cancelled
                  ? MyColors.redColor
                  : MyColors.greenColor,
          borderRadius: 100,
        );
  }
}
