31 lines
818 B
Swift
31 lines
818 B
Swift
//
|
|
// https://mczachurski.dev
|
|
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
|
// Licensed under the MIT License.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct NoDataView: View {
|
|
|
|
private let imageSystemName: String
|
|
private let text: LocalizedStringKey
|
|
|
|
init(imageSystemName: String, text: LocalizedStringKey) {
|
|
self.imageSystemName = imageSystemName
|
|
self.text = text
|
|
}
|
|
|
|
var body: some View {
|
|
VStack {
|
|
Image(systemName: self.imageSystemName)
|
|
.font(.largeTitle)
|
|
.padding(.bottom, 4)
|
|
Text(self.text, comment: "No data message")
|
|
.font(.title3)
|
|
}
|
|
.foregroundColor(.lightGrayColor)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
|
}
|
|
}
|