part of 'device_managment_bloc.dart';

abstract class DeviceManagementEvent extends Equatable {
  const DeviceManagementEvent();

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

class FetchDevices extends DeviceManagementEvent {
  // final Map<String, List<String>> selectedCommunitiesSpaces;
  // final String spaceId;
  final BuildContext context;

  const FetchDevices(this.context);
  @override
  List<Object?> get props => [context];
}

class FilterDevices extends DeviceManagementEvent {
  final String filter;

  const FilterDevices(this.filter);

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

class SelectedFilterChanged extends DeviceManagementEvent {
  final int selectedIndex;

  const SelectedFilterChanged(this.selectedIndex);

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

class SearchDevices extends DeviceManagementEvent {
  final String? community;
  final String? unitName;
  final String? deviceNameOrProductName;
  final bool searchField;

  const SearchDevices({
    this.community,
    this.unitName,
    this.deviceNameOrProductName,
    this.searchField = false,
  });

  @override
  List<Object?> get props => [community, unitName, deviceNameOrProductName];
}

class SelectDevice extends DeviceManagementEvent {
  final AllDevicesModel selectedDevice;

  const SelectDevice(this.selectedDevice);

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

class ResetFilters extends DeviceManagementEvent {}

class ResetSelectedDevices extends DeviceManagementEvent {}

class UpdateSelection extends DeviceManagementEvent {
  final List<bool> selectedRows;

  const UpdateSelection(this.selectedRows);
}

class UpdateDeviceName extends DeviceManagementEvent {
  final String deviceId;
  final String newName;

  const UpdateDeviceName({required this.deviceId, required this.newName});
}

class UpdateSubSpaceName extends DeviceManagementEvent {
  final String deviceId;
  final String newSubSpaceName;
  final String subspaceId;

  const UpdateSubSpaceName(
      {required this.deviceId,
      required this.newSubSpaceName,
      required this.subspaceId});
}
