mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
d3ffa30bf5
- Statistics page: library stat cards, recently played, most played, highest rated, genre chart - Playlists page: list layout with sort (Name/Tracks/Duration) and filter input - Favorites songs: full tracklist layout with artist column, context menu, enqueue-all button - AlbumDetail: extracted AlbumHeader and AlbumTrackList components - Artist cards: square cover, same sizing as album cards (clamp 140-180px) - Random Albums: removed renderKey remount, added loadingRef guard, fixed manual refresh race - Context menu: "Go to Album" option for song and queue-item types - Queue panel meta box: artist → artist page, album → album page, removed year - Random Mix: hover persistence via .context-active class while context menu is open - i18n: "Warteschlange" consistently used for queue in German Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import { SubsonicArtist, buildCoverArtUrl, coverArtCacheKey } from '../api/subsonic';
|
|
import { useNavigate } from 'react-router-dom';
|
|
import { Users } from 'lucide-react';
|
|
import CachedImage from './CachedImage';
|
|
|
|
interface Props {
|
|
artist: SubsonicArtist;
|
|
}
|
|
|
|
export default function ArtistCardLocal({ artist }: Props) {
|
|
const navigate = useNavigate();
|
|
const coverId = artist.coverArt || artist.id;
|
|
|
|
return (
|
|
<div className="artist-card" onClick={() => navigate(`/artist/${artist.id}`)}>
|
|
<div className="artist-card-avatar">
|
|
{coverId ? (
|
|
<CachedImage
|
|
src={buildCoverArtUrl(coverId, 300)}
|
|
cacheKey={coverArtCacheKey(coverId, 300)}
|
|
alt={artist.name}
|
|
loading="lazy"
|
|
onError={(e) => {
|
|
e.currentTarget.style.display = 'none';
|
|
e.currentTarget.parentElement?.classList.add('fallback-visible');
|
|
}}
|
|
/>
|
|
) : (
|
|
<Users size={32} color="var(--text-muted)" />
|
|
)}
|
|
</div>
|
|
<div className="artist-card-info">
|
|
<span className="artist-card-name" data-tooltip={artist.name}>{artist.name}</span>
|
|
{typeof artist.albumCount === 'number' && (
|
|
<span className="artist-card-meta">
|
|
{artist.albumCount} {artist.albumCount === 1 ? 'Album' : 'Alben'}
|
|
</span>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|