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

class VitalSignShimmerWidget extends StatelessWidget {
  const VitalSignShimmerWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        // BMI Card Shimmer
        Expanded(child: _buildShimmerCard()),
        SizedBox(width: 8.w),
        // Height Card Shimmer
        Expanded(child: _buildShimmerCard()),
        SizedBox(width: 8.w),
        // Weight Card Shimmer
        Expanded(child: _buildShimmerCard()),
        SizedBox(width: 8.w),
        // Blood Pressure Card Shimmer
        Expanded(child: _buildShimmerCard()),
      ],
    );
  }

  Widget _buildShimmerCard() {
    return Container(
      decoration: BoxDecoration(
        color: AppColors.whiteColor,
        borderRadius: BorderRadius.circular(12.r),
      ),
      child: Padding(
        padding: EdgeInsets.all(12.w),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisSize: MainAxisSize.min,
          children: [
            // Icon shimmer
            Container(
              width: 32.w,
              height: 32.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(8.r),
              ),
            ).toShimmer(),
            SizedBox(height: 8.h),
            // Label shimmer
            Container(
              width: 50.w,
              height: 10.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(4.r),
              ),
            ).toShimmer(),
            SizedBox(height: 4.h),
            // Value shimmer
            Container(
              width: 40.w,
              height: 16.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(4.r),
              ),
            ).toShimmer(),
            SizedBox(height: 4.h),
            // Chip shimmer
            Container(
              width: 45.w,
              height: 18.h,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(12.r),
              ),
            ).toShimmer(),
            SizedBox(height: 4.h),
            // Arrow shimmer
            Align(
              alignment: AlignmentDirectional.centerEnd,
              child: Container(
                width: 10.w,
                height: 10.h,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(2.r),
                ),
              ).toShimmer(),
            ),
          ],
        ),
      ),
    );
  }
}

