import 'package:hmg_patient_app_new/core/enums.dart';

class OrganModel {
  final String id;
  final String name;
  final String nameAr;
  final String description;
  final String descriptionAr;
  final BodyView bodyView;
  final OrganPosition position;

  const OrganModel({
    required this.id,
    required this.name,
    required this.nameAr,
    required this.description,
    required this.descriptionAr,
    required this.bodyView,
    required this.position,
  });

  /// Get localized name based on isArabic flag
  String getLocalizedName(bool isArabic) {
    return isArabic ? nameAr : name;
  }

  /// Get localized description based on isArabic flag
  String getLocalizedDescription(bool isArabic) {
    return isArabic ? descriptionAr : description;
  }

  OrganModel copyWith({
    String? id,
    String? name,
    String? nameAr,
    String? description,
    String? descriptionAr,
    BodyView? bodyView,
    OrganPosition? position,
  }) {
    return OrganModel(
      id: id ?? this.id,
      name: name ?? this.name,
      nameAr: nameAr ?? this.nameAr,
      description: description ?? this.description,
      descriptionAr: descriptionAr ?? this.descriptionAr,
      bodyView: bodyView ?? this.bodyView,
      position: position ?? this.position,
    );
  }
}

class OrganPosition {
  final double x; // Percentage from left (0.0 to 1.0)
  final double y; // Percentage from top (0.0 to 1.0)

  const OrganPosition({
    required this.x,
    required this.y,
  });
}
