damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

ReplyPart.swift (753B)


      1 //
      2 //  ReplyPart.swift
      3 //  damus
      4 //
      5 //  Created by William Casarin on 2023-06-01.
      6 //
      7 
      8 import SwiftUI
      9 
     10 struct ReplyPart: View {
     11     let events: EventCache
     12     let event: NostrEvent
     13     let keypair: Keypair
     14     let ndb: Ndb
     15 
     16     var body: some View {
     17         Group {
     18             if let reply_ref = event.thread_reply(keypair)?.reply {
     19                 ReplyDescription(event: event, replying_to: events.lookup(reply_ref.note_id), ndb: ndb)
     20             } else {
     21                 EmptyView()
     22             }
     23         }
     24     }
     25 }
     26 
     27 struct ReplyPart_Previews: PreviewProvider {
     28     static var previews: some View {
     29         ReplyPart(events: test_damus_state.events, event: test_note, keypair: Keypair(pubkey: .empty, privkey: nil), ndb: test_damus_state.ndb)
     30     }
     31 }