import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:taafee_mobile/common/const/const.dart';
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
import 'package:taafee_mobile/features/home/business_logic_layer/home_controller.dart';

import '../../../../common/widgets/text.dart';

class CardServiceWidget extends StatelessWidget {
  final CardModel cardModel;
  final HomeController homeController = Get.find<HomeController>();
  final int maxLines;
  final double? width;
  CardServiceWidget({super.key, required this.cardModel, this.maxLines = 1, this.width});

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      //mainAxisSize: MainAxisSize.min,
      children: [
        MediumTextWidget("${'description'.tr} : "),

        //width: Responsive.isTablet() ? Get.width * 0.3 : null,
        SizedBox(
          width: width ?? (Responsive.isTablet() ? Get.width * 0.3 : Get.width * 0.65),
          child: RegularTextWidget(
            cardModel.services,
            maxLines: maxLines,
            textAlign: homeController.isArabic.value ? TextAlign.right : TextAlign.left,
            overflow: TextOverflow.ellipsis,
          ).paddingOnly(
            right: Responsive.isTablet() ? 0 : 10,
            left: 7.5,
          ),
        ),
      ],
    );
  }
}
