import 'package:equatable/equatable.dart';
import '../../../models/activity.dart';

/// States pour les activités Google Places
abstract class GoogleActivityState extends Equatable {
  const GoogleActivityState();

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

/// État initial
class GoogleActivityInitial extends GoogleActivityState {
  const GoogleActivityInitial();
}

/// État de recherche
class GoogleActivitySearching extends GoogleActivityState {
  const GoogleActivitySearching();
}

/// État avec les activités Google chargées
class GoogleActivityLoaded extends GoogleActivityState {
  final List<Activity> googleActivities;
  final String? nextPageToken;
  final bool hasMoreData;
  final String query;

  const GoogleActivityLoaded({
    required this.googleActivities,
    this.nextPageToken,
    required this.hasMoreData,
    required this.query,
  });

  @override
  List<Object?> get props => [googleActivities, nextPageToken, hasMoreData, query];

  /// Créer une copie avec des modifications
  GoogleActivityLoaded copyWith({
    List<Activity>? googleActivities,
    String? nextPageToken,
    bool? hasMoreData,
    String? query,
  }) {
    return GoogleActivityLoaded(
      googleActivities: googleActivities ?? this.googleActivities,
      nextPageToken: nextPageToken ?? this.nextPageToken,
      hasMoreData: hasMoreData ?? this.hasMoreData,
      query: query ?? this.query,
    );
  }
}

/// État de chargement de plus d'activités (pagination)
class GoogleActivityLoadingMore extends GoogleActivityState {
  final List<Activity> currentActivities;
  final String query;

  const GoogleActivityLoadingMore({
    required this.currentActivities,
    required this.query,
  });

  @override
  List<Object?> get props => [currentActivities, query];
}

/// État de succès d'opération
class GoogleActivityOperationSuccess extends GoogleActivityState {
  final String message;

  const GoogleActivityOperationSuccess(this.message);

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

/// État d'erreur
class GoogleActivityError extends GoogleActivityState {
  final String message;

  const GoogleActivityError(this.message);

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