import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/group_devices_model.dart';
import 'package:syncrow_app/features/devices/model/device_info_model.dart';
import 'package:syncrow_app/features/devices/model/six_scene_question_model.dart';
import 'package:syncrow_app/features/devices/model/six_scene_model.dart';
import 'package:syncrow_app/features/devices/model/subspace_model.dart';
import 'package:syncrow_app/features/scene/model/scenes_model.dart';

class SixSceneState extends Equatable {
  const SixSceneState();

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

class SixSceneLoadingState extends SixSceneState {}

class SaveState extends SixSceneState {}

class UpdateStateList extends SixSceneState {
  final List<GroupDevicesModel> groupDevices;
  final List<GroupDevicesModel> devices;
  const UpdateStateList({required this.groupDevices, required this.devices});
}

class SixSceneFailedState extends SixSceneState {
  final String errorMessage;

  const SixSceneFailedState({required this.errorMessage});

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

class UpdateState extends SixSceneState {
  final SixSceneModel device;
  const UpdateState({required this.device});

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

class LoadingNewSate extends SixSceneState {
  final SixSceneModel device;
  const LoadingNewSate({required this.device});

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

class NameEditingState extends SixSceneState {
  final bool editName;

  const NameEditingState({required this.editName});
}

class FaqLoadedState extends SixSceneState {
  final List<SixSceneQuestionModel> filteredFaqQuestions;

  const FaqLoadedState({this.filteredFaqQuestions = const []});
}

class FaqSearchState extends SixSceneState {
  final List<SixSceneQuestionModel> filteredFaqQuestions;

  const FaqSearchState({this.filteredFaqQuestions = const []});
}

class FetchRoomsState extends SixSceneState {
  final List<SubSpaceModel> roomsList;
  final List<DeviceModel> devicesList;

  const FetchRoomsState({required this.devicesList, required this.roomsList});

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

class ChangeSwitchState extends SixSceneState {
  final bool isEnable;

  const ChangeSwitchState({required this.isEnable});
}

class SceneLoaded extends SixSceneState {
  final List<ScenesModel> scenes;
  final String? loadingSceneId;
  final Map<String, bool> loadingStates;

  const SceneLoaded(this.scenes,
      {this.loadingSceneId, this.loadingStates = const {}});
}

class SearchResultsState extends SixSceneState {}
class SuccessState extends SixSceneState {}

class SaveSelectionSuccessState extends SixSceneState {}

class OptionSelectedState extends SixSceneState {
  final String selectedOption;
  final bool hasSelectionChanged;

  const OptionSelectedState({
    required this.selectedOption,
    required this.hasSelectionChanged,
  });

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

class SceneSelectionUpdatedState extends SixSceneState {
  final String selectedSceneId;

  const SceneSelectionUpdatedState({required this.selectedSceneId});
}

class LoadingDeviceInfo extends SixSceneState {
  final DeviceInfoModel deviceInfo;
  const LoadingDeviceInfo({required this.deviceInfo});

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