import 'package:equatable/equatable.dart';

abstract class AuthState extends Equatable {
  const AuthState();

  @override
  List<Object> get props => [];
}

class LoginInitial extends AuthState {}

class AuthTokenLoading extends AuthState {}

class AuthLoading extends AuthState {}

class AuthInitialState extends AuthState {}

class LoginSuccess extends AuthState {}

class LoginFailure extends AuthState {
  final String error;

  const LoginFailure({required this.error});

  @override
  List<Object> get props => [error];
}

class LoginValid extends AuthState {}

class LoginInvalid extends AuthState {
  final String error;

  const LoginInvalid({required this.error});

  @override
  List<Object> get props => [error];
}

class InitialForgetState extends AuthState {}

class LoadingForgetState extends AuthState {}

class SuccessForgetState extends AuthState {}

class PasswordVisibleState extends AuthState {}

class FailureForgetState extends AuthState {
  final String error;
  const FailureForgetState({required this.error});
  @override
  List<Object> get props => [error];
}

class TimerState extends AuthState {
  final bool isButtonEnabled;
  final int remainingTime;

  const TimerState({required this.isButtonEnabled, required this.remainingTime});

  @override
  List<Object> get props => [isButtonEnabled, remainingTime];
}

class AuthError extends AuthState {
  final String message;
  final String? code;
  const AuthError({required this.message, this.code});
}

class AuthTokenError extends AuthError {
  const AuthTokenError({required super.message, super.code});
}

class AuthSuccess extends AuthState {}

class AuthTokenSuccess extends AuthSuccess {}

class TimerUpdated extends AuthState {
  final String formattedTime;
  final bool isButtonEnabled;

  TimerUpdated({
    required this.formattedTime,
    required this.isButtonEnabled,
  });
}
