import RastrilloApple import SwiftUI /// Both platforms use the kit's full onboarding, with pairing as an explicit route. public struct EquipoSignInView: View { let app: EquipoAppModel public init(model: EquipoAppModel) { app = model } public var body: some View { if app.showingPairing { PairingView(model: app) .safeAreaInset(edge: .bottom) { Button(String(localized: "oficina.sign_in", bundle: .module)) { Task { await app.useOficinaID() } }.padding() } } else { EquipoOnboarding(app: app, model: app.oficina.model) } } } private struct EquipoOnboarding: View { let app: EquipoAppModel @ObservedObject var model: OficinaIDModel var body: some View { Group { if case .signedIn = model.step { VStack(spacing: 16) { if let error = app.oficina.error { Text(error) Button(String(localized: "oficina.retry", bundle: .module)) { Task { await app.oficina.synchronize() } } } else { ProgressView(String(localized: "oficina.connecting", bundle: .module)) } Button(OficinaIDText.text("otherWays")) { app.otherWays() } Button(OficinaIDText.text("signOut", model.identity?.label ?? ""), role: .destructive) { app.oficina.signOut() } }.padding(24) } else { OficinaOnboardingView(model: model, otherWays: { app.otherWays() }) } } } }