import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/four_scene_model.dart';
import 'package:syncrow_app/features/devices/model/question_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/subspace_model.dart';
import 'package:syncrow_app/features/scene/model/scenes_model.dart';

class FourSceneState extends Equatable {
  const FourSceneState();

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

class FourSceneLoadingState extends FourSceneState {}

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

class FourSceneFailedState extends FourSceneState {
  final String errorMessage;

  const FourSceneFailedState({required this.errorMessage});

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

class UpdateState extends FourSceneState {
  final FourSceneModelState device;
  const UpdateState({required this.device});

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

class LoadingNewSate extends FourSceneState {
  final FourSceneModelState device;
  const LoadingNewSate({required this.device});

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

class NameEditingState extends FourSceneState {
  final bool editName;

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

class FaqLoadedState extends FourSceneState {
  final List<QuestionModel> filteredFaqQuestions;

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

class FaqSearchState extends FourSceneState {
  final List<QuestionModel> filteredFaqQuestions;

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

class FetchRoomsState extends FourSceneState {
  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 FourSceneState {
  final bool isEnable;

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

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

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

class SearchResultsState extends FourSceneState {}

class SaveState extends FourSceneState {}

class SaveSelectionSuccessState extends FourSceneState {}

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

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

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

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

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

class SceneSelectionUpdatedState extends FourSceneState {
  final String selectedSceneId;

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