Add lead workflows, PDF signing, AR projects and photo gallery integration

This commit is contained in:
Dennis Nemec
2026-11-08 17:49:39 +01:00
parent a343bde741
commit 8d18873412
82 changed files with 6401 additions and 34 deletions

View File

@ -0,0 +1,47 @@
import SwiftUI
import SwiftData
/// Composition boundary: the AR picker receives only neutral project data.
struct LeadARProjectsSheet: View {
let detail: LeadDetail
@Environment(\.modelContext) private var context
@State private var service: LeadARProjectsService?
var body: some View {
Group {
if let service {
LeadARProjectsContent(service: service)
} else {
ProgressView()
}
}
.task {
if service == nil {
service = LeadARProjectsService(detail: detail, container: context.container)
}
}
}
}
private struct LeadARProjectsContent: View {
let service: LeadARProjectsService
@State private var activeProject: Project?
@State private var errorMessage: String?
var body: some View {
ARProjectsSheet(service: service) { id in
do { activeProject = try service.resolveProject(id: id) }
catch { errorMessage = error.localizedDescription }
}
.fullScreenCover(item: $activeProject) { project in
if let context = project.modelContext {
ARExperienceView(project: project).modelContext(context)
}
}
.alert("AR-Projekt konnte nicht geöffnet werden",
isPresented: Binding(get: { errorMessage != nil },
set: { if !$0 { errorMessage = nil } })) {
Button("OK", role: .cancel) { errorMessage = nil }
} message: { Text(errorMessage ?? "") }
}
}