// // ProjectDetailView.swift // GasTankAR // // Created by Dennis Nemec on 25.08.26. // import SwiftUI import SwiftData struct ProjectDetailView: View { @Bindable var project: Project @State private var isARPresented = false var body: some View { TabView { detailsTab .tabItem { Label("Details", systemImage: "info.circle") } GalleryView(project: project) .tabItem { Label("Galerie", systemImage: "photo.on.rectangle") } DocuframeView(project: project) .tabItem { Label("DOCUframe", systemImage: "arrow.up.doc.on.clipboard") } } .navigationTitle(project.customerName) .navigationBarTitleDisplayMode(.inline) } private var detailsTab: some View { List { Section("Projektdaten") { LabeledContent("Kunde", value: project.customerName) LabeledContent("Lead-ID", value: project.leadID) LabeledContent( "Erstellt am", value: project.creationDate.formatted(.dateTime.day().month().year()) ) } TankSelectionSection(tank: $project.tank) } .safeAreaInset(edge: .bottom) { Button { isARPresented = true } label: { Label("AR-Modus starten", systemImage: "arkit") .font(.headline) .frame(maxWidth: .infinity) .frame(height: 50) } .buttonStyle(.borderedProminent) .padding() } .fullScreenCover(isPresented: $isARPresented) { ARExperienceView(project: project) } } } #Preview { let sample = PreviewSupport.singleProjectContainer() return NavigationStack { ProjectDetailView(project: sample.project) } .modelContainer(sample.container) }