Create BearWave macOS radio-first app

This commit is contained in:
Sebastian Palencsar
2026-06-25 09:21:42 +02:00
commit b47b591e03
42 changed files with 3814 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import SwiftUI
struct ManualStationView: View {
@Environment(AppModel.self) private var model
@Environment(\.dismiss) private var dismiss
@State private var name = ""
@State private var url = ""
@State private var country = ""
var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text("Add station manually")
.font(.title2.bold())
TextField("Name", text: $name)
TextField("Stream URL (http/https)", text: $url)
TextField("Country (optional)", text: $country)
HStack {
Spacer()
Button("Cancel") {
dismiss()
}
Button("Add") {
model.library.addManualStation(name: name, url: url, country: country)
dismiss()
}
.keyboardShortcut(.defaultAction)
.disabled(name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty || URL(string: url) == nil)
}
}
.textFieldStyle(.roundedBorder)
.padding(24)
.frame(width: 430)
}
}