import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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' show AppColors;

class ClinicItem extends StatelessWidget {
  final String clinicName;
  final bool isArabic;

  ClinicItem({super.key, required this.clinicName, required this.isArabic});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(16.h),
      decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
        color: AppColors.whiteColor,
        borderRadius: 24.h,
        hasShadow: false,
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Utils.buildSvgWithAssets(
              icon: AppAssets.generic_clinic_icon,
              width: 24.h,
              height: 24.h,
              fit: BoxFit.contain),
          SizedBox(height: 16.h),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Expanded(child: clinicName.toText16(isBold: true)),
              Transform.flip(
                flipX: isArabic,
                child: Utils.buildSvgWithAssets(
                    icon: AppAssets.forward_arrow_icon_small,
                    width: 15.h,
                    height: 15.h,
                    fit: BoxFit.contain,
                    iconColor: AppColors.textColor),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
