this repo has no description
at main 1.6 kB view raw
1// 2// AccountDetailView.swift 3// AtProtoBackup 4// 5// Created by Corey Alexander on 8/25/25. 6// 7 8import SwiftUI 9 10struct AccountDetailView: View { 11 let account: Account 12 @StateObject private var downloadManager = DownloadManager() 13 14 var body: some View { 15 VStack(alignment: .leading, spacing: 16) { 16 Text("Account Details") 17 .font(.title2) 18 .fontWeight(.bold) 19 20 AccountInfoSection(account: account) 21 22 DownloadSection(account: account, downloadManager: downloadManager) 23 24 Spacer() 25 } 26 .padding() 27 .navigationTitle(account.handle) 28 } 29} 30 31struct AccountInfoSection: View { 32 let account: Account 33 34 var body: some View { 35 VStack(alignment: .leading, spacing: 8) { 36 HStack { 37 Text("Handle:") 38 .fontWeight(.semibold) 39 Text(account.handle) 40 } 41 42 HStack { 43 Text("DID:") 44 .fontWeight(.semibold) 45 Text(account.did) 46 .lineLimit(1) 47 .truncationMode(.middle) 48 } 49 50 HStack { 51 Text("PDS:") 52 .fontWeight(.semibold) 53 Text(account.pds) 54 .lineLimit(1) 55 .truncationMode(.tail) 56 } 57 } 58 } 59} 60 61#Preview { 62 AccountDetailView( 63 account: Account( 64 did: "did:plc:example", 65 handle: "user.bsky.social", 66 pds: "https://bsky.network" 67 ) 68 ) 69}