Add lead workflows, PDF signing, AR projects and photo gallery integration
This commit is contained in:
@ -0,0 +1,60 @@
|
||||
import SwiftUI
|
||||
|
||||
struct LeadSigningDocumentListView: View {
|
||||
let documents: [LeadDocument]
|
||||
let currentID: String?
|
||||
let signedIDs: Set<String>
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("DOKUMENTE").font(.caption).foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 6)
|
||||
VStack(spacing: 0) {
|
||||
ForEach(Array(documents.enumerated()), id: \.element.id) { index, document in
|
||||
LeadSigningDocumentRow(
|
||||
title: document.title.replacingOccurrences(of: ".pdf", with: ""),
|
||||
number: index + 1,
|
||||
isCurrent: document.id == currentID && document.status != .signed && !signedIDs.contains(document.id),
|
||||
isSigned: document.status == .signed || signedIDs.contains(document.id)
|
||||
)
|
||||
if document.id != documents.last?.id {
|
||||
Divider().padding(.leading, 44)
|
||||
}
|
||||
}
|
||||
}
|
||||
.background(Color(uiColor: .secondarySystemGroupedBackground), in: .rect(cornerRadius: 12))
|
||||
.clipShape(.rect(cornerRadius: 12))
|
||||
}
|
||||
.padding(12)
|
||||
}
|
||||
}
|
||||
|
||||
struct LeadSigningDocumentRow: View {
|
||||
let title: String
|
||||
let number: Int
|
||||
let isCurrent: Bool
|
||||
let isSigned: Bool
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 12) {
|
||||
if isSigned {
|
||||
Image(systemName: "checkmark.circle.fill").foregroundStyle(.green).frame(width: 20)
|
||||
} else {
|
||||
Text(number.formatted()).foregroundStyle(isCurrent ? Color.accentColor : .secondary)
|
||||
.frame(width: 20)
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
Text(title).fontWeight(isCurrent ? .semibold : .regular).lineLimit(2)
|
||||
Text(isSigned ? "Unterschrieben" : isCurrent ? "Jetzt unterschreiben" : "Ausstehend")
|
||||
.font(.caption)
|
||||
.foregroundStyle(isSigned ? Color.green : isCurrent ? Color.accentColor : .secondary)
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
.padding(12)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.background(isCurrent ? Color.accentColor.opacity(0.10) : .clear)
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityAddTraits(isCurrent ? .isSelected : [])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user