class HelpTextContent {
  final String key;
  final String scope;
  final String title;
  final String content;
  final DateTime? updatedAt;

  const HelpTextContent({
    required this.key,
    required this.scope,
    required this.title,
    required this.content,
    this.updatedAt,
  });

  factory HelpTextContent.fromJson(Map<String, dynamic> json) {
    return HelpTextContent(
      key: (json['key'] as String? ?? '').trim(),
      scope: (json['scope'] as String? ?? 'default').trim(),
      title: (json['title'] as String? ?? '').trim(),
      content: (json['content'] as String? ?? '').trim(),
      updatedAt: json['updatedAt'] is String
          ? DateTime.tryParse(json['updatedAt'] as String)
          : null,
    );
  }
}
