TeraTodayCurrentDetail.swift (1043B)
1 import SwiftUI 2 3 /// Navigation retains identity; the visible value always comes from the store. 4 struct TeraTodayCurrentDetail: View { 5 let cardID: String 6 @ObservedObject var store: TeraTodayStore 7 let context: TeraLocalNetwork? 8 @ObservedObject var mediaStore: TeraMediaStore 9 let canRevise: Bool 10 let canRetract: Bool 11 let revise: (TeraTodayCard) -> Void 12 let retract: (TeraTodayCard) -> Void 13 14 var body: some View { 15 if let card = store.currentCard(id: cardID) { 16 TeraTodayDetailView( 17 card: card, context: context, mediaStore: mediaStore, 18 canRevise: canRevise && card.localOperationID != nil, canRetract: canRetract, 19 revise: revise, retract: retract 20 ) 21 .environment(\.timeZone, store.viewerCalendar?.timeZone ?? .current) 22 } else { 23 ContentUnavailableView( 24 "Post unavailable", systemImage: "eye.slash", 25 description: Text("This post is no longer available in this local network.") 26 ) 27 .accessibilityIdentifier("tera.today.detail.unavailable") 28 } 29 } 30 }