import ManaCore import SwiftUI /// Phase β-0-Placeholder. Wird in β-1 durch eine echte Tab-Bar mit /// Decks / Study / Stats / Account ersetzt. struct DashboardView: View { @Environment(AuthClient.self) private var auth @State private var apiReachable: Bool? var body: some View { ZStack { CardsTheme.background.ignoresSafeArea() VStack(spacing: 24) { Text("Cards") .font(.largeTitle.bold()) .foregroundStyle(CardsTheme.primary) if let email = auth.currentEmail { Text("Angemeldet als \(email)") .font(.subheadline) .foregroundStyle(CardsTheme.mutedForeground) } ContentUnavailableView { Label("β-1 in Vorbereitung", systemImage: "rectangle.stack") .foregroundStyle(CardsTheme.foreground) } description: { Text("Decks- und Study-Views kommen in der nächsten Phase.") .foregroundStyle(CardsTheme.mutedForeground) } if let reachable = apiReachable { Label( reachable ? "cardecky-api erreichbar" : "cardecky-api nicht erreichbar", systemImage: reachable ? "checkmark.circle.fill" : "xmark.circle.fill" ) .foregroundStyle(reachable ? CardsTheme.success : CardsTheme.error) .font(.footnote) } Button("Abmelden", role: .destructive) { Task { await auth.signOut() } } .padding(.top, 24) } .padding(32) } .task { let api = CardsAPI(auth: auth) apiReachable = (try? await api.healthCheck()) ?? false } } } #Preview { DashboardView() .environment(AuthClient(config: AppConfig.manaAppConfig)) }