40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
import SwiftUI
|
|
|
|
struct RevealView: View {
|
|
let title: String
|
|
let subtitle: String
|
|
let statusText: String
|
|
let selectionLabel: String
|
|
let selectionValue: String
|
|
let continueTitle: String
|
|
let onContinue: () -> Void
|
|
|
|
@EnvironmentObject private var analytics: HermesAnalyticsClient
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: HermesTheme.sectionSpacing) {
|
|
HermesSectionHeader(title: title, subtitle: subtitle)
|
|
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
HermesMetricPill(label: selectionLabel, value: selectionValue)
|
|
|
|
Text(statusText)
|
|
.font(.callout)
|
|
.foregroundStyle(HermesTheme.textSecondary)
|
|
}
|
|
|
|
Button {
|
|
analytics.track("reveal_completed", attributes: ["screen_name": "reveal", "selection": selectionValue])
|
|
onContinue()
|
|
} label: {
|
|
Text(continueTitle)
|
|
}
|
|
.buttonStyle(HermesPrimaryButtonStyle())
|
|
}
|
|
.onAppear {
|
|
analytics.track("screen_viewed", attributes: ["screen_name": "reveal"])
|
|
analytics.track("reveal_started", attributes: ["screen_name": "reveal", "selection": selectionValue])
|
|
}
|
|
}
|
|
}
|