Impressia/Vernissage/Widgets/NoDataView.swift

31 lines
818 B
Swift
Raw Normal View History

2023-02-01 18:40:28 +01:00
//
// 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
2023-03-13 13:53:36 +01:00
private let text: LocalizedStringKey
2023-02-01 18:40:28 +01:00
2023-03-13 13:53:36 +01:00
init(imageSystemName: String, text: LocalizedStringKey) {
2023-02-01 18:40:28 +01:00
self.imageSystemName = imageSystemName
self.text = text
}
var body: some View {
VStack {
Image(systemName: self.imageSystemName)
.font(.largeTitle)
.padding(.bottom, 4)
2023-03-13 13:53:36 +01:00
Text(self.text, comment: "No data message")
2023-02-01 18:40:28 +01:00
.font(.title3)
}
.foregroundColor(.lightGrayColor)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
}
}