import 'package:equatable/equatable.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/subspace_model.dart';

abstract class ManageUnitState extends Equatable {
  const ManageUnitState();

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

class InitialState extends ManageUnitState {}

class LoadingState extends ManageUnitState {}

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

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

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

class FetchDeviceByRoomIdState extends ManageUnitState {
  final List<DeviceModel> roomDevices;
  final List<DeviceModel> allDevices;
  final Map<String, bool> roomDevicesId;
  final String roomId;

  const FetchDeviceByRoomIdState(
      {required this.roomDevices,
      required this.allDevices,
      required this.roomDevicesId,
      required this.roomId});

  @override
  List<Object> get props => [roomDevices, allDevices, roomDevicesId, roomId];
}

class AssignRoomState extends ManageUnitState {}

class ErrorState extends ManageUnitState {
  final String message;

  const ErrorState({required this.message});

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