Add scan progress view
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ScanProgressView: View {
|
||||
let progress: ScanProgress
|
||||
let onCancel: () -> Void
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 14) {
|
||||
if let fraction = progress.fractionCompleted {
|
||||
ProgressView(value: fraction) {
|
||||
Text(progress.phase.label)
|
||||
} currentValueLabel: {
|
||||
Text(progress.detailText)
|
||||
.monospacedDigit()
|
||||
}
|
||||
} else {
|
||||
ProgressView {
|
||||
Text(progress.phase.label)
|
||||
}
|
||||
}
|
||||
|
||||
Button("中止", role: .cancel, action: onCancel)
|
||||
}
|
||||
.frame(width: 300)
|
||||
.padding(24)
|
||||
.background(.regularMaterial, in: RoundedRectangle(cornerRadius: 14, style: .continuous))
|
||||
.shadow(radius: 20)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user