import { buildCoverArtUrl, coverArtCacheKey } from '../api/subsonicStreamUrl'; import type { SubsonicArtist } from '../api/subsonicTypes'; import React, { useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import { Users } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import CachedImage from './CachedImage'; interface Props { artist: SubsonicArtist; } export default function ArtistCardLocal({ artist }: Props) { const { t } = useTranslation(); const navigate = useNavigate(); const coverId = artist.coverArt || artist.id; // buildCoverArtUrl generates a new crypto salt on every call — must be // memoized to prevent a new URL on every parent re-render causing refetch loops. const coverSrc = useMemo(() => buildCoverArtUrl(coverId, 300), [coverId]); const coverCacheKey = useMemo(() => coverArtCacheKey(coverId, 300), [coverId]); return (