// 数据库测试页状态（Demo，正式开发后随页面一并删除）

/// 单条测试结果记录
class TestResult {
  final String title;
  final String subtitle;
  final String duration;

  TestResult({
    required this.title,
    required this.subtitle,
    required this.duration,
  });
}

class ChatDbTestState {
  final bool testStarted;
  final List<TestResult> testResults;
  final String currentState;

  const ChatDbTestState({
    this.testStarted = false,
    this.testResults = const [],
    this.currentState = '',
  });

  /// 按钮文案（Widget 直接读，不在 View 层做判断）
  String get buttonLabel => testStarted ? '结束' : '开始';

  ChatDbTestState copyWith({
    bool? testStarted,
    List<TestResult>? testResults,
    String? currentState,
  }) => ChatDbTestState(
    testStarted: testStarted ?? this.testStarted,
    testResults: testResults ?? this.testResults,
    currentState: currentState ?? this.currentState,
  );
}
