import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';

class OrganDot extends StatelessWidget {
  final bool isSelected;
  final VoidCallback onTap;
  final double size;

  const OrganDot({super.key, required this.isSelected, required this.onTap, this.size = 50.0});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: AnimatedContainer(
        duration: const Duration(milliseconds: 250),
        curve: Curves.easeInOut,
        width: size.w,
        height: size.h,
        decoration: BoxDecoration(
          shape: BoxShape.circle,
          color: isSelected ? AppColors.whiteColor : AppColors.blackColor.withValues(alpha: 0.6),
        ),
        child: Padding(
          padding: EdgeInsets.all(isSelected ? 2.w : 3.w),
          child: Container(
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor,
            ),
            child: isSelected
                ? Center(
                    child: Container(
                      width: size.w * 0.25,
                      height: size.h * 0.25,
                      decoration: BoxDecoration(
                        shape: BoxShape.circle,
                        color: AppColors.whiteColor,
                      ),
                    ),
                  )
                : null,
          ),
        ),
      ),
    );
  }
}
