import Foundation

enum CameraConnectionState: Equatable {
    case disconnected
    case searching
    case connecting
    case connected(deviceName: String)
    case error(String)

    var displayText: String {
        switch self {
        case .disconnected:
            "未连接"
        case .searching:
            "正在搜索相机…"
        case .connecting:
            "正在连接…"
        case .connected(let name):
            "已连接：\(name)"
        case .error(let message):
            "错误：\(message)"
        }
    }

    var isConnected: Bool {
        if case .connected = self { return true }
        return false
    }
}
