35 lines
1.1 KiB
Swift
35 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct LeadSigningHeaderView: ToolbarContent {
|
|
let offerID: String
|
|
let current: Int
|
|
let total: Int
|
|
let isComplete: Bool
|
|
let isSigning: Bool
|
|
let canConfirm: Bool
|
|
let onClose: () -> Void
|
|
|
|
var body: some ToolbarContent {
|
|
ToolbarItem(placement: .cancellationAction) {
|
|
Button(role: .cancel, action: onClose)
|
|
.labelStyle(.iconOnly)
|
|
.disabled(isSigning)
|
|
}
|
|
ToolbarItem(placement: .principal) {
|
|
VStack(spacing: 3) {
|
|
Text(offerID).font(.headline)
|
|
if isComplete {
|
|
Text("Alle Dokumente unterschrieben").font(.caption).foregroundStyle(.secondary)
|
|
} else {
|
|
Text("Dokument \(current) von \(total)").font(.caption).foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
ToolbarItem(placement: .confirmationAction) {
|
|
Button(role: .confirm, action: onClose)
|
|
.labelStyle(.iconOnly)
|
|
.disabled(!canConfirm)
|
|
}
|
|
}
|
|
}
|