44 lines
1.1 KiB
Swift
44 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct VerificationStatusView: View {
|
|
let status: String // "verified", "trusted", "unverified"
|
|
|
|
var body: some View {
|
|
HStack(spacing: 6) {
|
|
Image(systemName: iconName)
|
|
.foregroundStyle(iconColor)
|
|
Text(displayText)
|
|
.font(.subheadline.bold())
|
|
.foregroundStyle(iconColor)
|
|
}
|
|
.padding(.horizontal, 12)
|
|
.padding(.vertical, 6)
|
|
.background(iconColor.opacity(0.12))
|
|
.clipShape(Capsule())
|
|
}
|
|
|
|
private var iconName: String {
|
|
switch status {
|
|
case "verified": return "checkmark.shield.fill"
|
|
case "trusted": return "shield.fill"
|
|
default: return "shield.slash"
|
|
}
|
|
}
|
|
|
|
private var iconColor: Color {
|
|
switch status {
|
|
case "verified": return .green
|
|
case "trusted": return .blue
|
|
default: return .secondary
|
|
}
|
|
}
|
|
|
|
private var displayText: String {
|
|
switch status {
|
|
case "verified": return "Verified"
|
|
case "trusted": return "Trusted"
|
|
default: return "Unverified"
|
|
}
|
|
}
|
|
}
|