import SwiftUI struct MenuBarLabel: View { let snapshot: MetricsSnapshot var body: some View { // Use one native image/title label: the previous multi-view HStack showed // only its first image and percentage in the user-verified menu bar. Label { Text(verbatim: title) .monospacedDigit() } icon: { Image(systemName: "gauge") } .labelStyle(.titleAndIcon) } private var title: String { var items = ["CPU \(percent(snapshot.cpu?.usage))"] if let gpu = snapshot.gpuUsage { items.append("GPU \(percent(gpu))") } items.append("MEM \(percent(snapshot.memory?.usage))") return items.joined(separator: " ยท ") } private func percent(_ value: Double?) -> String { value.map { "\(Int(($0 * 100).rounded()))%" } ?? "--" } }