import 'package:equatable/equatable.dart';

abstract class MessageEvent extends Equatable {
  const MessageEvent();

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

class LoadMessages extends MessageEvent {
  final String groupId;

  const LoadMessages(this.groupId);

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

class SendMessage extends MessageEvent {
  final String groupId;
  final String text;
  final String senderId;
  final String senderName;

  const SendMessage({
    required this.groupId,
    required this.text,
    required this.senderId,
    required this.senderName,
  });

  @override
  List<Object?> get props => [groupId, text, senderId, senderName];
}

class DeleteMessage extends MessageEvent {
  final String groupId;
  final String messageId;

  const DeleteMessage({
    required this.groupId,
    required this.messageId,
  });

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

class UpdateMessage extends MessageEvent {
  final String groupId;
  final String messageId;
  final String newText;

  const UpdateMessage({
    required this.groupId,
    required this.messageId,
    required this.newText,
  });

  @override
  List<Object?> get props => [groupId, messageId, newText];
}

class ReactToMessage extends MessageEvent {
  final String groupId;
  final String messageId;
  final String userId;
  final String reaction;

  const ReactToMessage({
    required this.groupId,
    required this.messageId,
    required this.userId,
    required this.reaction,
  });

  @override
  List<Object?> get props => [groupId, messageId, userId, reaction];
}

class RemoveReaction extends MessageEvent {
  final String groupId;
  final String messageId;
  final String userId;

  const RemoveReaction({
    required this.groupId,
    required this.messageId,
    required this.userId,
  });

  @override
  List<Object?> get props => [groupId, messageId, userId];
}
