You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

//
// StatusView.swift
// Diffusion-macOS
//
// Created by Cyril Zakka on 1/12/23.
//
import SwiftUI
struct StatusView: View {
var pipelineState: Binding<PipelineState>
var body: some View {
switch pipelineState.wrappedValue {
case .downloading(let progress):
ProgressView("Downloading…", value: progress*100, total: 110).padding()
case .uncompressing:
ProgressView("Uncompressing…", value: 100, total: 110).padding()
case .loading:
ProgressView("Loading…", value: 105, total: 110).padding()
case .ready:
Button {
// Generate image here
} label: {
Text("Generate")
.frame(maxWidth: .infinity)
.frame(height: 50)
}
.buttonStyle(.borderedProminent)
case .failed:
Text("Pipeline loading error")
}
}
}
struct StatusView_Previews: PreviewProvider {
static var previews: some View {
StatusView(pipelineState: .constant(.downloading(0.2)))
}
}