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 DeviceSettingState extends Equatable {
  const DeviceSettingState();

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

class DeviceSettingLoadingState extends DeviceSettingState {}

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

class DeviceSettingFailedState extends DeviceSettingState {
  final String errorMessage;

  const DeviceSettingFailedState({required this.errorMessage});

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

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

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

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

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

class NameEditingState extends DeviceSettingState {
  final bool editName;

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

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

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

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

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

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

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

class SettingLoaded extends DeviceSettingState {
  final List<ScenesModel> scenes;
  final String? loadingSettingId;
  final Map<String, bool> loadingStates;

  const SettingLoaded(this.scenes,
      {this.loadingSettingId, this.loadingStates = const {}});
}

class SearchResultsState extends DeviceSettingState {}

class SaveState extends DeviceSettingState {}
class SuccessState extends DeviceSettingState {}

class SaveSelectionSuccessState extends DeviceSettingState {}

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

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

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

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

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

class SettingSelectionUpdatedState extends DeviceSettingState {
  final String selectedSettingId;

  const SettingSelectionUpdatedState({required this.selectedSettingId});
}
