import 'package:flutter/material.dart' ;
import 'package:hmg_patient_app_new/core/app_export.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/utils.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';

class LabHistoryItem extends StatelessWidget{

  final String dayNameAndDate;
  final String result;
  final String assetUrl;
  final bool shouldRotateIcon;

  const LabHistoryItem({super.key, required this.dayNameAndDate, required this.result, required this.assetUrl, this.shouldRotateIcon = false});

  @override
  Widget build(BuildContext context) => Row(
    mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
    children: [
      Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            dayNameAndDate,
            style: TextStyle(
              fontSize: 14.f,
                fontWeight: FontWeight.w600,
              fontFamily: getIt.get<AppState>().isArabic() ? 'CairoArabic' : 'Poppins',
              color: AppColors.labelTextColor
            ),
          ),
          Text(
            result,
            style: TextStyle(
              fontSize: 18.f,
                fontWeight: FontWeight.w600,
              fontFamily: getIt.get<AppState>().isArabic() ? 'CairoArabic' : 'Poppins',
              color: AppColors.textColor
            ),
          )
        ],
      ),
      Transform.flip(
        flipY: shouldRotateIcon,
          child: Utils.buildSvgWithAssets(icon: assetUrl, height: 18, width: 18)
      ),
    ],
  );

}