import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';

class LabRadCard extends StatelessWidget {
  const LabRadCard({
    super.key,
    required this.icon,
    required this.labelText,
    required this.labOrderTests,
    required this.isLoading,
  });

  final String icon;
  final String labelText;
  final List<String> labOrderTests;

  final bool isLoading;

  @override
  Widget build(BuildContext context) {
    AppState appState = getIt.get<AppState>();
    return Container(
      decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 18.r, hasShadow: false),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        mainAxisSize: MainAxisSize.max,
        children: [
          Expanded(
            child: Row(
              children: [
                Utils.buildSvgWithAssets(
                  icon: icon,
                  width: 40.w,
                  height: 40.h,
                  fit: BoxFit.cover,
                  applyThemeColor: false
                ).toShimmer2(isShow: false, radius: 12.r),
                SizedBox(width: 8.w),
                Flexible(child: labelText.toText12(isBold: true, maxLine: 2)),
              ],
            ),
          ),

          SizedBox(width: 12.w),
          Transform.flip(
            flipX: appState.isArabic(),
            child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon_small, width: 12.h, height: 12.h, fit: BoxFit.contain, iconColor: AppColors.textColor),
          ),
        ],
      ).paddingAll(12.w),
    );
  }
}
