class InvitePreview {
  const InvitePreview({
    required this.valid,
    required this.email,
    required this.teamName,
    this.clubName,
    this.teamId,
    this.error,
  });

  final bool valid;
  final String email;
  final String teamName;
  final String? clubName;
  final String? teamId;
  final String? error;

  factory InvitePreview.fromJson(Map<String, dynamic> json) {
    return InvitePreview(
      valid: json['valid'] as bool? ?? false,
      email: json['email'] as String? ?? '',
      teamName: json['team_name'] as String? ?? '',
      clubName: json['club_name'] as String?,
      teamId: json['team_id'] as String?,
      error: json['error'] as String?,
    );
  }
}
