field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraPublicationTargetsView.swift (1469B)


      1 import SwiftUI
      2 
      3 struct TeraPublicationTargetsView: View {
      4   let details: TeraPublicationTargets
      5 
      6   var body: some View {
      7     DisclosureGroup("Saved relay evidence") {
      8       Text(details.policySummary).font(.footnote)
      9       ForEach(details.targets) { target in
     10         VStack(alignment: .leading, spacing: 4) {
     11           Text(target.endpoint).font(.caption).textSelection(.enabled)
     12           if details.isRequired(target.id) {
     13             Text("Required by the saved policy").font(.caption)
     14           }
     15           Text(target.summary)
     16           if target.accepted, target.rejected {
     17             Text("A separate refusal is also recorded.").font(.caption)
     18           }
     19           if let observed = target.readBackObservedAtUnixMilliseconds {
     20             Text("Read-back observed on \(Date(timeIntervalSince1970: Double(observed) / 1000).formatted()).")
     21               .font(.caption)
     22           } else {
     23             Text("No read-back observation is shown for this relay.").font(.caption)
     24           }
     25         }
     26       }
     27       if !details.readBackAvailable {
     28         Text("Saved read-back evidence is unavailable.").font(.footnote)
     29       } else if !details.readBackComplete {
     30         Text("Read-back evidence shown is a bounded subset.").font(.footnote)
     31       }
     32       Text("Read-back is separate from acceptance. Neither proves continued retention or delivery to every relay.")
     33         .font(.footnote)
     34     }
     35     .accessibilityIdentifier("tera.submission.relay_evidence")
     36   }
     37 }