import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:smart_hotel_app/models/bo/alert_dashboard_bo.dart';

class EquipmentItem {
  final IconData icon;
  final String title;
  final String subtitle;
  final String status;
  final Color statusColor;

  const EquipmentItem({
    required this.icon,
    required this.title,
    required this.subtitle,
    required this.status,
    required this.statusColor,
  });
}

class HomeIndexState extends Equatable {
  final bool isLoading;
  final String? error;
  final int highAlarmCount;
  final int mediumAlarmCount;
  final int onlineDeviceCount;
  final List<AlertItemBO> alerts;
  final List<EquipmentItem> equipmentList;

  const HomeIndexState({
    this.isLoading = false,
    this.error,
    this.highAlarmCount = 0,
    this.mediumAlarmCount = 0,
    this.onlineDeviceCount = 0,
    this.alerts = const [],
    this.equipmentList = const [],
  });

  HomeIndexState copyWith({
    bool? isLoading,
    String? error,
    int? highAlarmCount,
    int? mediumAlarmCount,
    int? onlineDeviceCount,
    List<AlertItemBO>? alerts,
    List<EquipmentItem>? equipmentList,
  }) {
    return HomeIndexState(
      isLoading: isLoading ?? this.isLoading,
      error: error,
      highAlarmCount: highAlarmCount ?? this.highAlarmCount,
      mediumAlarmCount: mediumAlarmCount ?? this.mediumAlarmCount,
      onlineDeviceCount: onlineDeviceCount ?? this.onlineDeviceCount,
      alerts: alerts ?? this.alerts,
      equipmentList: equipmentList ?? this.equipmentList,
    );
  }

  @override
  List<Object?> get props => [
        isLoading,
        error,
        highAlarmCount,
        mediumAlarmCount,
        onlineDeviceCount,
        alerts,
        equipmentList,
      ];
}