radio view fix

This commit is contained in:
Dallas Groot 2026-04-04 18:06:08 -07:00
parent c3e387f185
commit b4e64b545f

View file

@ -219,38 +219,38 @@ struct RadioView: View {
}
// MARK: - Station Row
@ViewBuilder
private func stationRow(_ station: RadioStation) -> some View {
let canPlay = libraryCache.isServerAvailable
Button(action: {
if canPlay { playStation(station) }
if libraryCache.isServerAvailable { playStation(station) }
}) {
HStack(spacing: 14) {
RadioStationCover(
stationId: station.id,
isPlaying: playingStationId == station.id
)
.opacity(canPlay ? 1.0 : 0.4)
.opacity(libraryCache.isServerAvailable ? 1.0 : 0.4)
VStack(alignment: .leading, spacing: 3) {
Text(station.name)
.font(.system(size: 16, weight: .medium))
.foregroundColor(
!canPlay ? .gray.opacity(0.4) :
!libraryCache.isServerAvailable ? .gray.opacity(0.4) :
playingStationId == station.id ? accentPink : .white
)
if let home = station.homePageUrl, !home.isEmpty {
Text(home)
.font(.system(size: 12))
.foregroundColor(canPlay ? .gray : .gray.opacity(0.3))
.foregroundColor(libraryCache.isServerAvailable ? .gray : .gray.opacity(0.3))
.lineLimit(1)
}
}
Spacer()
if playingStationId == station.id && canPlay {
if playingStationId == station.id && libraryCache.isServerAvailable {
Image(systemName: "waveform")
.font(.system(size: 14))
.foregroundColor(accentPink)