2022-12-10 02:01:59 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct CacheStatusHeader: View {
|
|
|
|
var refreshTime: String
|
|
|
|
var isLoading = false
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
HStack(spacing: 6) {
|
|
|
|
ProgressView()
|
|
|
|
.progressViewStyle(.circular)
|
|
|
|
.scaleEffect(Constants.progressViewScale, anchor: .center)
|
|
|
|
.opacity(isLoading ? 1 : 0)
|
|
|
|
Text(refreshTime)
|
|
|
|
}
|
2022-12-11 11:38:57 +00:00
|
|
|
.font(.caption.monospacedDigit())
|
2022-12-10 02:01:59 +00:00
|
|
|
.foregroundColor(.secondary)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct CacheStatusHeader_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
CacheStatusHeader(refreshTime: "15:10:20")
|
|
|
|
}
|
|
|
|
}
|