import SwiftUI

struct WatchTransfersView: View {
    @ObservedObject var transfer: WatchSessionTransfer
    var body: some View {
        List {
            Text(transfer.status)
            Text("Original Watch archives are retained here. Share them to Files for analysis; they are not unpacked into iPhone sessions.").font(.caption)
            ForEach(transfer.received, id: \.self) { url in
                ShareLink(item: url) { Label("Watch archive \(url.deletingPathExtension().lastPathComponent.prefix(8))", systemImage: "square.and.arrow.up") }
            }
        }.navigationTitle("Watch transfers").onAppear { transfer.refresh() }
    }
}
