- Show stable group health in a fixed 2x2 metric grid - Add link-chain state to fleet cards and parse hardware/control/SIM/cellular - Replace the wrapped icon with a full-bleed app icon - Bump the IPA build number
52 lines
1.0 KiB
Swift
52 lines
1.0 KiB
Swift
import SwiftUI
|
|
|
|
struct AISkeletonLine: View {
|
|
let width: CGFloat?
|
|
let height: CGFloat
|
|
|
|
init(width: CGFloat? = nil, height: CGFloat) {
|
|
self.width = width
|
|
self.height = height
|
|
}
|
|
|
|
init(width fraction: CGFloat, height: CGFloat) {
|
|
self.init(width: nil, height: height)
|
|
self.fraction = fraction
|
|
}
|
|
|
|
private var fraction: CGFloat?
|
|
|
|
var body: some View {
|
|
Group {
|
|
if let fraction {
|
|
GeometryReader { proxy in
|
|
Capsule(style: .continuous)
|
|
.frame(width: max(0, proxy.size.width * fraction))
|
|
}
|
|
} else if let width {
|
|
Capsule(style: .continuous)
|
|
.frame(width: width)
|
|
}
|
|
}
|
|
.frame(height: height)
|
|
.background(AISkeletonFill())
|
|
}
|
|
}
|
|
|
|
struct AISkeletonCard: View {
|
|
let height: CGFloat
|
|
|
|
var body: some View {
|
|
RoundedRectangle(cornerRadius: 14, style: .continuous)
|
|
.frame(height: height)
|
|
.background(AISkeletonFill())
|
|
}
|
|
}
|
|
|
|
private struct AISkeletonFill: View {
|
|
var body: some View {
|
|
Rectangle()
|
|
.fill(AITheme.control)
|
|
}
|
|
}
|