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

abstract class GroupState extends Equatable {
  const GroupState();

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

// État initial
class GroupInitial extends GroupState {}

// Chargement
class GroupLoading extends GroupState {}

// Groupes chargés
class GroupsLoaded extends GroupState {
  final List<Group> groups;

  const GroupsLoaded(this.groups);

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

class GroupLoaded extends GroupState {
  final List<Group> groups;

  const GroupLoaded(this.groups);
}

class GroupCreated extends GroupState {
  final String groupId;
  final String message;

  const GroupCreated({
    required this.groupId,
    this.message = 'Groupe créé avec succès',
  });
  @override
  List<Object?> get props => [groupId, message];
}

// Succès d'une opération
class GroupOperationSuccess extends GroupState {
  final String message;

  const GroupOperationSuccess(this.message);

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

// Erreur
class GroupError extends GroupState {
  final String message;

  const GroupError(this.message);

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