67 lines
1.8 KiB
Swift
67 lines
1.8 KiB
Swift
//
|
|
// ProjectDetailView.swift
|
|
// GasTankAR
|
|
//
|
|
// Created by Dennis Nemec on 25.08.26.
|
|
//
|
|
|
|
import SwiftUI
|
|
import SwiftData
|
|
|
|
struct ProjectDetailView: View {
|
|
@Bindable var project: Project
|
|
|
|
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())
|
|
)
|
|
}
|
|
|
|
Section("Tankauswahl") {
|
|
TankEditor(tank: $project.tank)
|
|
}
|
|
}
|
|
.safeAreaInset(edge: .bottom) {
|
|
NavigationLink {
|
|
ARExperienceView(project: project)
|
|
} label: {
|
|
Label("AR-Modus starten", systemImage: "arkit")
|
|
.font(.headline)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: 50)
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.padding()
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
let sample = PreviewSupport.singleProjectContainer()
|
|
|
|
return NavigationStack {
|
|
ProjectDetailView(project: sample.project)
|
|
}
|
|
.modelContainer(sample.container)
|
|
}
|