Initial Commit
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ArtistDetailView.swift
|
||||
// Mobile Music Assistant
|
||||
//
|
||||
// Created by Sven Hanold on 26.03.26.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ArtistDetailView: View {
|
||||
@Environment(MAService.self) private var service
|
||||
let artist: MAArtist
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 24) {
|
||||
// Artist Header
|
||||
VStack(spacing: 16) {
|
||||
// Artist Image
|
||||
if let imageUrl = artist.imageUrl {
|
||||
let coverURL = service.imageProxyURL(path: imageUrl, size: 512)
|
||||
|
||||
CachedAsyncImage(url: coverURL) { image in
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
} placeholder: {
|
||||
Circle()
|
||||
.fill(Color.gray.opacity(0.2))
|
||||
}
|
||||
.frame(width: 250, height: 250)
|
||||
.clipShape(Circle())
|
||||
.shadow(radius: 10)
|
||||
} else {
|
||||
Circle()
|
||||
.fill(Color.gray.opacity(0.2))
|
||||
.frame(width: 250, height: 250)
|
||||
.overlay {
|
||||
Image(systemName: "music.mic")
|
||||
.font(.system(size: 60))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.top)
|
||||
|
||||
// TODO: Load artist albums, top tracks, etc.
|
||||
Text("Artist details coming soon")
|
||||
.foregroundStyle(.secondary)
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
.navigationTitle(artist.name)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
ArtistDetailView(
|
||||
artist: MAArtist(
|
||||
uri: "library://artist/1",
|
||||
name: "Test Artist",
|
||||
imageUrl: nil,
|
||||
sortName: nil,
|
||||
musicbrainzId: nil
|
||||
)
|
||||
)
|
||||
.environment(MAService())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user