import 'package:recording_tool/core/platform/device_health_snapshot.dart';

class DeviceHealthChecker {
  DeviceHealthChecker._();

  static const int thresholdPercent = 10;

  static const String lowBatteryMessage = '电量低于10%，请充电';
  static const String lowStorageMessage = '内存低于10%，请清理内存';

  static List<String> warningLines(DeviceHealthSnapshot snapshot) {
    final lines = <String>[];

    final battery = snapshot.batteryLevelPercent;
    if (battery != null && battery < thresholdPercent) {
      lines.add(lowBatteryMessage);
    }

    if (snapshot.storageAvailablePercent < thresholdPercent) {
      lines.add(lowStorageMessage);
    }

    return lines;
  }
}
