|
|
|
|
@ -26,6 +26,35 @@ struct ContentView: View { |
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
VStack(spacing: 0) { |
|
|
|
|
if let status = networkStatus { |
|
|
|
|
switch status.mode { |
|
|
|
|
case .remote(let hostName): |
|
|
|
|
HStack(spacing: 8) { |
|
|
|
|
Image(systemName: "antenna.radiowaves.left.and.right") |
|
|
|
|
.font(.system(size: 10)).foregroundStyle(.blue) |
|
|
|
|
Text("Connected to \(hostName)") |
|
|
|
|
.font(.system(size: 11, weight: .medium)).foregroundStyle(.blue) |
|
|
|
|
Spacer() |
|
|
|
|
Button("Refresh") { status.onRefreshLibrary?() } |
|
|
|
|
.font(.system(size: 11)).buttonStyle(.plain).foregroundStyle(.secondary) |
|
|
|
|
Button("Disconnect") { status.onDisconnect?() } |
|
|
|
|
.font(.system(size: 11)).buttonStyle(.plain).foregroundStyle(.red) |
|
|
|
|
} |
|
|
|
|
.padding(.horizontal, 12).padding(.vertical, 4) |
|
|
|
|
.background(Color.blue.opacity(0.08)) |
|
|
|
|
case .hosting(let remoteName): |
|
|
|
|
HStack(spacing: 8) { |
|
|
|
|
Image(systemName: "antenna.radiowaves.left.and.right") |
|
|
|
|
.font(.system(size: 10)).foregroundStyle(.green) |
|
|
|
|
Text(remoteName != nil ? "Hosting · \(remoteName!) connected" : "Hosting") |
|
|
|
|
.font(.system(size: 11, weight: .medium)).foregroundStyle(.green) |
|
|
|
|
Spacer() |
|
|
|
|
} |
|
|
|
|
.padding(.horizontal, 12).padding(.vertical, 4) |
|
|
|
|
.background(Color.green.opacity(0.08)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SearchBarView( |
|
|
|
|
searchText: $searchText, |
|
|
|
|
trackCount: playlist.selectedItem != nil ? playlist.playlistTracks.count : library.trackCount, |
|
|
|
|
@ -152,6 +181,7 @@ struct ContentView: View { |
|
|
|
|
playlists: playlist.allPlaylists, |
|
|
|
|
selectedItem: showHome ? nil : playlist.selectedItem, |
|
|
|
|
isHomeSelected: showHome, |
|
|
|
|
isRemoteMode: networkStatus?.isRemoteMode ?? false, |
|
|
|
|
onHomeSelect: { |
|
|
|
|
if showHome { |
|
|
|
|
showHome = false |
|
|
|
|
|