Add lead workflows, PDF signing, AR projects and photo gallery integration
This commit is contained in:
42
GasTankAR/Views/Leads/Signing/LeadSigningPreviewView.swift
Normal file
42
GasTankAR/Views/Leads/Signing/LeadSigningPreviewView.swift
Normal file
@ -0,0 +1,42 @@
|
||||
import SwiftUI
|
||||
import PDFKit
|
||||
import QuickLook
|
||||
|
||||
struct LeadSigningPreviewView: View {
|
||||
let offerID: String
|
||||
let url: URL
|
||||
let placement: PDFSignaturePlacement?
|
||||
@State private var showsPreview = false
|
||||
@State private var pageNumber = 1
|
||||
@State private var pageCount = 1
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text("VORSCHAU · \(offerID)")
|
||||
Spacer()
|
||||
Button("In Vorschau öffnen", systemImage: "arrow.up.left.and.arrow.down.right") {
|
||||
showsPreview = true
|
||||
}
|
||||
.font(.subheadline)
|
||||
.foregroundStyle(.tint)
|
||||
}
|
||||
.font(.caption).foregroundStyle(.secondary).padding(.horizontal, 16)
|
||||
LeadPDFView(url: url, signaturePlacement: placement, fitsWholePage: true) { current, total in
|
||||
pageNumber = current
|
||||
pageCount = total
|
||||
}
|
||||
.frame(height: 310)
|
||||
.clipShape(.rect(cornerRadius: 12))
|
||||
.overlay(RoundedRectangle(cornerRadius: 12).stroke(.gray.opacity(0.25)))
|
||||
Text("Seite \(pageNumber) von \(pageCount)")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.fullScreenCover(isPresented: $showsPreview) {
|
||||
LeadDocumentPreview(url: url)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user