import 'package:equatable/equatable.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/devices/model/device_info_model.dart';

abstract class SosEvent extends Equatable {
  const SosEvent();

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

class DeleteDeviceEvent extends SosEvent {}

class SosInitialDeviseInfo extends SosEvent {}

class SosInitial extends SosEvent {
  const SosInitial();
}

class ReportLogsInitial extends SosEvent {
  const ReportLogsInitial();
}

class ToggleEnableAlarmEvent extends SosEvent {
  final bool isLowBatteryEnabled;

  const ToggleEnableAlarmEvent(this.isLowBatteryEnabled);

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

class ToggleClosingReminderEvent extends SosEvent {
  final bool isClosingReminderEnabled;

  const ToggleClosingReminderEvent(this.isClosingReminderEnabled);

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

class SaveNameEvent extends SosEvent {}

class ChangeNameEvent extends SosEvent {
  final bool? value;
  const ChangeNameEvent({this.value});
}

class SearchFaqEvent extends SosEvent {
  final String query;

  const SearchFaqEvent(this.query);
}

class SosInitialQuestion extends SosEvent {
  const SosInitialQuestion();
}

class FetchRoomsEvent extends SosEvent {
  final SpaceModel unit;

  const FetchRoomsEvent({required this.unit});

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

class SelectOptionEvent extends SosEvent {
  dynamic selectedOption;
  SelectOptionEvent({
    this.selectedOption,
  });
}

class SaveSelectionEvent extends SosEvent {
  BuildContext context;
  SaveSelectionEvent({
    required this.context,
  });
}

class AssignRoomEvent extends SosEvent {
  final String roomId;
  final SpaceModel unit;
  final BuildContext context;

  const AssignRoomEvent({
    required this.roomId,
    required this.unit,
    required this.context,
  });

  @override
  List<Object> get props => [
        roomId,
        unit,
        context,
      ];
}

class UnassignRoomEvent extends SosEvent {
  final String roomId;
  final String deviceId;
  final SpaceModel unit;

  const UnassignRoomEvent(
      {required this.roomId, required this.deviceId, required this.unit});

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

class LoadingDeviceInfo extends SosEvent {
  DeviceInfoModel deviceInfo;
  LoadingDeviceInfo({required this.deviceInfo});

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

class ToggleUpdateEvent extends SosEvent {
  final bool? isUpdateEnabled;
  const ToggleUpdateEvent({this.isUpdateEnabled});
}

class ToggleHelpfulEvent extends SosEvent {
  final bool? isHelpful;
  const ToggleHelpfulEvent({this.isHelpful});
}
