import SwiftUI /// Tone / severity of an insight, used to pick an accent color and to /// prioritize which insights are surfaced first. enum InsightTone { case positive case neutral case attention /// Higher priority insights are shown first when capping the list. var priority: Int { switch self { case .attention: return 2 case .positive: return 1 case .neutral: return 0 } } } struct PortfolioInsight: Identifiable { let id: String let systemImage: String let title: String let value: String let accentColor: Color /// Optional supporting line shown under the value in the richer card. let detail: String? let tone: InsightTone init( id: String, systemImage: String, title: String, value: String, accentColor: Color, detail: String? = nil, tone: InsightTone = .neutral ) { self.id = id self.systemImage = systemImage self.title = title self.value = value self.accentColor = accentColor self.detail = detail self.tone = tone } }