import 'package:recording_tool/features/auth/model/model_auth.dart';
import 'package:recording_tool/features/auth/model/model_jwt.dart';

class AuthState {
  const AuthState({
    this.isLoading = false,
    this.errorMessage,
    this.jwtDecodedData,
    this.recordList,
  });

  final bool isLoading;
  final String? errorMessage;

  /// 解析后的 TOKEN 数据
  final JwtDecodedData? jwtDecodedData;

  /// 赛事列表
  final List<RecordListItem>? recordList;

  AuthState copyWith({
    bool? isLoading,
    String? errorMessage,
    JwtDecodedData? jwtDecodedData,
    List<RecordListItem>? recordList,
  }) {
    return AuthState(
      isLoading: isLoading ?? this.isLoading,
      errorMessage: errorMessage ?? this.errorMessage,
      jwtDecodedData: jwtDecodedData ?? this.jwtDecodedData,
      recordList: recordList ?? this.recordList,
    );
  }
}
