28 lines
627 B
Swift
28 lines
627 B
Swift
import SwiftUI
|
|
|
|
struct OptionalTextFieldPropertyView: View {
|
|
|
|
let title: LocalizedStringKey
|
|
|
|
@Binding
|
|
var text: String?
|
|
|
|
let prompt: String?
|
|
|
|
let footer: LocalizedStringKey
|
|
|
|
init(title: LocalizedStringKey, text: Binding<String?>, prompt: String? = nil, footer: LocalizedStringKey) {
|
|
self.title = title
|
|
self._text = text
|
|
self.prompt = prompt
|
|
self.footer = footer
|
|
}
|
|
|
|
var body: some View {
|
|
GenericPropertyView(title: title, footer: footer) {
|
|
OptionalDescriptionField(text: $text)
|
|
.textFieldStyle(.roundedBorder)
|
|
}
|
|
}
|
|
}
|