35 lines
990 B
Swift
35 lines
990 B
Swift
import SwiftUI
|
|
|
|
struct EmptyStateView: View {
|
|
let symbol: String
|
|
let title: String
|
|
let message: String
|
|
let buttonTitle: String?
|
|
let action: (() -> Void)?
|
|
|
|
var body: some View {
|
|
VStack(spacing: Theme.Spacing.medium) {
|
|
Image(systemName: symbol)
|
|
.font(.system(size: 44, weight: .semibold))
|
|
.foregroundStyle(.secondary)
|
|
|
|
Text(title)
|
|
.font(.title3.weight(.semibold))
|
|
|
|
Text(message)
|
|
.font(.body)
|
|
.foregroundStyle(.secondary)
|
|
.multilineTextAlignment(.center)
|
|
|
|
if let buttonTitle, let action {
|
|
Button(buttonTitle, action: action)
|
|
.buttonStyle(.borderedProminent)
|
|
}
|
|
}
|
|
.padding(24)
|
|
.frame(maxWidth: .infinity)
|
|
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 20, style: .continuous))
|
|
.padding(.horizontal, 20)
|
|
}
|
|
}
|