import 'package:fl_chart/fl_chart.dart';

class AlarmInfo {
  final String alarmType;
  final String deviceInfo;
  final String alarmLevel;
  final String urgency;
  final String currentTemp;
  final String voltage;
  final String current;
  final String triggerTime;
  final String threshold;
  final String duration;
  final String peak;
  final String linkAction;
  final String date;
  final List<FlSpot> temperatureSpots;
  final String alertDeviceId;

  const AlarmInfo({
    required this.alarmType,
    required this.deviceInfo,
    required this.alarmLevel,
    required this.urgency,
    required this.currentTemp,
    required this.voltage,
    required this.current,
    required this.triggerTime,
    required this.threshold,
    required this.duration,
    required this.peak,
    required this.linkAction,
    required this.date,
    required this.temperatureSpots,
    required this.alertDeviceId,
  });
}

class AbnormalState {
  final bool isLoading;
  final String? error;
  final AlarmInfo? alarmInfo;
  final bool isHandling;
  final bool isHandled;

  const AbnormalState({
    this.isLoading = false,
    this.error,
    this.alarmInfo,
    this.isHandling = false,
    this.isHandled = false,
  });

  AbnormalState copyWith({
    bool? isLoading,
    String? error,
    AlarmInfo? alarmInfo,
    bool? isHandling,
    bool? isHandled,
  }) {
    return AbnormalState(
      isLoading: isLoading ?? this.isLoading,
      error: error ?? this.error,
      alarmInfo: alarmInfo ?? this.alarmInfo,
      isHandling: isHandling ?? this.isHandling,
      isHandled: isHandled ?? this.isHandled,
    );
  }
}