import 'package:equatable/equatable.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart';

enum DeviceControlIndexStatus { initial, loading, success, failure }

class DeviceControlIndexState extends Equatable {
  final DeviceControlIndexStatus status;
  final bool isLoading;
  final String? error;
  final List<MonitoringMetricBO> metrics;
  final String selectedMetricLabel;

  const DeviceControlIndexState({
    this.status = DeviceControlIndexStatus.initial,
    this.isLoading = false,
    this.error,
    this.metrics = const [],
    this.selectedMetricLabel = '',
  });

  DeviceControlIndexState copyWith({
    DeviceControlIndexStatus? status,
    bool? isLoading,
    String? error,
    List<MonitoringMetricBO>? metrics,
    String? selectedMetricLabel,
  }) {
    return DeviceControlIndexState(
      status: status ?? this.status,
      isLoading: isLoading ?? this.isLoading,
      error: error ?? this.error,
      metrics: metrics ?? this.metrics,
      selectedMetricLabel: selectedMetricLabel ?? this.selectedMetricLabel,
    );
  }

  @override
  List<Object?> get props => [
        status,
        isLoading,
        error,
        metrics,
        selectedMetricLabel,
      ];
}
