import SwiftUI struct NOVABadge: View { let novaGroup: Int var body: some View { VStack(spacing: 8) { ZStack { RoundedRectangle(cornerRadius: 12) .fill(novaColor) .frame(width: 80, height: 80) VStack(spacing: 2) { Text("NOVA") .font(.caption2.bold()) .foregroundColor(.white.opacity(0.8)) Text("\(novaGroup)") .font(.system(size: 36, weight: .bold, design: .rounded)) .foregroundColor(.white) } } Text(novaLabel) .font(.caption) .foregroundColor(.secondary) .multilineTextAlignment(.center) .frame(width: 100) } } private var novaColor: Color { switch novaGroup { case 1: return .green case 2: return .yellow case 3: return .orange default: return .red } } private var novaLabel: String { switch novaGroup { case 1: return "Unprocessed" case 2: return "Processed ingredients" case 3: return "Processed" default: return "Ultra-processed" } } }