enum AlarmStatus { all, pending, processed, falseAlarm }

class AlarmItem {
  final String id;
  final String title;
  final String deviceInfo;
  final String alarmTime;
  final String processTime;
  final AlarmStatus status;
  final String level;
  final String urgency;

  const AlarmItem({
    required this.id,
    required this.title,
    required this.deviceInfo,
    required this.alarmTime,
    required this.processTime,
    required this.status,
    required this.level,
    required this.urgency,
  });
}

class AbnormalListState {
  final AlarmStatus currentFilter;
  final List<AlarmItem> alarmList;

  const AbnormalListState({
    required this.currentFilter,
    required this.alarmList,
  });

  AbnormalListState copyWith({
    AlarmStatus? currentFilter,
    List<AlarmItem>? alarmList,
  }) {
    return AbnormalListState(
      currentFilter: currentFilter ?? this.currentFilter,
      alarmList: alarmList ?? this.alarmList,
    );
  }

  List<AlarmItem> get filteredList {
    if (currentFilter == AlarmStatus.all) {
      return alarmList;
    }
    return alarmList.where((item) => item.status == currentFilter).toList();
  }
}
