feat(web): similar-artists strip + top-tracks panel on artist detail
This commit is contained in:
@@ -56,6 +56,8 @@ export const qk = {
|
||||
home: () => ['home'] as const,
|
||||
albumsAlpha: () => ['albumsAlpha'] as const,
|
||||
artistTracks: (artistId: string) => ['artistTracks', artistId] as const,
|
||||
similarArtists: (artistId: string) => ['similarArtists', artistId] as const,
|
||||
artistTopTracks: (artistId: string) => ['artistTopTracks', artistId] as const,
|
||||
playlists: (kind?: 'user' | 'system' | 'all') =>
|
||||
['playlists', { kind: kind ?? 'user' }] as const,
|
||||
playlist: (id: string) => ['playlist', id] as const,
|
||||
@@ -88,6 +90,22 @@ export function createAlbumQuery(id: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export function createSimilarArtistsQuery(id: string) {
|
||||
return createQuery({
|
||||
queryKey: qk.similarArtists(id),
|
||||
queryFn: () => api.get<ArtistRef[]>(`/api/artists/${id}/similar`),
|
||||
enabled: id.length > 0,
|
||||
});
|
||||
}
|
||||
|
||||
export function createArtistTopTracksQuery(id: string) {
|
||||
return createQuery({
|
||||
queryKey: qk.artistTopTracks(id),
|
||||
queryFn: () => api.get<TrackRef[]>(`/api/artists/${id}/top-tracks`),
|
||||
enabled: id.length > 0,
|
||||
});
|
||||
}
|
||||
|
||||
export function createSearchQuery(q: string) {
|
||||
return createQuery({
|
||||
queryKey: qk.search(q),
|
||||
|
||||
Reference in New Issue
Block a user