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

class OrganTooltipWidget extends StatelessWidget {
  final String organName;
  final Offset position;

  const OrganTooltipWidget({super.key, required this.organName, required this.position});

  @override
  Widget build(BuildContext context) {
    return Positioned(
      left: position.dx,
      top: position.dy,
      child: FractionalTranslation(
        translation: const Offset(-0.5, -1.2), // Center horizontally, position above the dot
        child: Container(
          padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 6.h),
          decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
            color: AppColors.scaffoldBgColor,
            borderRadius: 8.h,
            hasShadow: true,
          ),
          child: Text(
            organName,
            style: TextStyle(
              color: AppColors.textColor,
              fontSize: 12.f,
              fontWeight: FontWeight.w600,
            ),
          ),
        ),
      ),
    );
  }
}
