SecureStorageSample/SecureStorageSample Watch App/ContentView.swift

47 lines
1.2 KiB
Swift

//
// ContentView.swift
// SecureStorageSample Watch App
//
// Created by Matt Bruce on 1/14/26.
//
import SwiftUI
import SharedKit
struct ContentView: View {
@State private var store = WatchProfileStore.shared
var body: some View {
VStack {
if let profile = store.profile {
Text(profile.name)
.bold()
Text(profile.email)
.font(.caption)
.foregroundStyle(.secondary)
Text("Age: \(profile.ageDescription)")
.font(.caption2)
.foregroundStyle(.secondary)
Text(profile.createdAt, format: .dateTime)
.font(.caption2)
.foregroundStyle(.secondary)
} else {
Text("No profile synced yet")
.font(.caption)
.foregroundStyle(.secondary)
}
if !store.statusMessage.isEmpty {
Text(store.statusMessage)
.font(.caption2)
.foregroundStyle(.secondary)
}
}
.padding()
}
}
#Preview {
ContentView()
}