Initial commit for first version of project
This commit is contained in:
66
GasTankAR/Views/ProjectDetailView.swift
Normal file
66
GasTankAR/Views/ProjectDetailView.swift
Normal file
@ -0,0 +1,66 @@
|
||||
//
|
||||
// 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)
|
||||
}
|
||||
Reference in New Issue
Block a user