59 lines
1.9 KiB
Swift
59 lines
1.9 KiB
Swift
import SwiftUI
|
|
import Bedrock
|
|
|
|
struct WidgetEmptyStateView: View {
|
|
let iconSize: SymbolIcon.Size
|
|
let title: String
|
|
let subtitle: String
|
|
let symbolName: String
|
|
let timeRange: String
|
|
let nextRitual: String?
|
|
let isCompact: Bool
|
|
|
|
var body: some View {
|
|
VStack(spacing: Design.Spacing.small) {
|
|
if isCompact {
|
|
HStack(alignment: .center, spacing: Design.Spacing.small){
|
|
iconView
|
|
titleView
|
|
}
|
|
} else {
|
|
iconView
|
|
titleView
|
|
}
|
|
if let nextRitual {
|
|
Text(nextRitual)
|
|
.styled(.caption, emphasis: .custom(AppTextColors.secondary))
|
|
.multilineTextAlignment(.center)
|
|
.padding(.top, Design.Spacing.small)
|
|
}
|
|
|
|
Text(String(localized: "Enjoy this moment. Your next ritual will appear when it's time."))
|
|
.styled(.caption, emphasis: .custom(AppTextColors.tertiary))
|
|
.multilineTextAlignment(.center)
|
|
.lineLimit(2)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.padding(.top, Design.Spacing.small)
|
|
}
|
|
.padding(.horizontal, Design.Spacing.small)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
}
|
|
|
|
var iconView: some View {
|
|
SymbolIcon(symbolName, size: iconSize, color: AppAccent.primary.opacity(0.6))
|
|
}
|
|
|
|
var titleView: some View {
|
|
VStack(spacing: Design.Spacing.xSmall) {
|
|
Text(title)
|
|
.styled(.subheading, emphasis: .custom(AppTextColors.primary))
|
|
.multilineTextAlignment(.center)
|
|
|
|
if !timeRange.isEmpty {
|
|
Text(timeRange)
|
|
.styled(.caption, emphasis: .custom(AppTextColors.tertiary))
|
|
}
|
|
}
|
|
}
|
|
}
|