Files
damus/damus/Views/Events/Components/ReplyPart.swift
William Casarin bb1f912f78 nip10: consolidate event_ref logic into ThreadReply
These are overlapping concepts, lets slowly get rid of EventRef

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-09 14:44:22 -07:00

32 lines
753 B
Swift

//
// ReplyPart.swift
// damus
//
// Created by William Casarin on 2023-06-01.
//
import SwiftUI
struct ReplyPart: View {
let events: EventCache
let event: NostrEvent
let keypair: Keypair
let ndb: Ndb
var body: some View {
Group {
if let reply_ref = event.thread_reply(keypair)?.reply {
ReplyDescription(event: event, replying_to: events.lookup(reply_ref.note_id), ndb: ndb)
} else {
EmptyView()
}
}
}
}
struct ReplyPart_Previews: PreviewProvider {
static var previews: some View {
ReplyPart(events: test_damus_state.events, event: test_note, keypair: Keypair(pubkey: .empty, privkey: nil), ndb: test_damus_state.ndb)
}
}