// // ReceiveView.swift // OS Vault // // Author: Simon-Pierre Boucher // Mail: contact@spboucher.ai // import SwiftUI struct ReceiveView: View { @EnvironmentObject var app: AppState @Environment(\.dismiss) private var dismiss var body: some View { VStack(spacing: 16) { HStack { Text("Receive").font(.title2.bold()) Spacer() NetworkBadge(network: app.network) } if let address = app.address { if let qr = QRCode.image(for: address) { Image(nsImage: qr) .interpolation(.none) .resizable() .frame(width: 220, height: 220) .background(.white) .clipShape(RoundedRectangle(cornerRadius: 8)) } Text(address) .font(.callout.monospaced()) .textSelection(.enabled) .padding(10) .background(.quaternary.opacity(0.4)) .clipShape(RoundedRectangle(cornerRadius: 8)) CopyButton(text: address) Text("Send only assets on \(app.network.config.displayName) (chain ID \(String(app.network.config.chainID))) to this address.") .font(.caption) .foregroundStyle(.secondary) .multilineTextAlignment(.center) } Button("Done") { dismiss() } .keyboardShortcut(.defaultAction) } .padding(24) .frame(width: 380) } }