import Button, { Color as ButtonColor } from '@/components/Button' import SvgIcon from '@/components/SvgIcon' import Cover from '@/components/Cover' import useArtist from '@/hooks/useArtist' import useArtistAlbums from '@/hooks/useArtistAlbums' import { resizeImage } from '@/utils/common' import dayjs from 'dayjs' import TracksGrid from '@/components/TracksGrid' import CoverRow, { Subtitle } from '@/components/CoverRow' import Skeleton from '@/components/Skeleton' import { Fragment } from 'react' const Artist = () => { const params = useParams() const { data: artist, isLoading } = useArtist({ id: Number(params.id) || 0, }) const { data: albumsRaw, isLoading: isLoadingAlbum } = useArtistAlbums({ id: Number(params.id) || 0, limit: 1000, }) const albums = useMemo(() => { if (!albumsRaw?.hotAlbums) return [] return albumsRaw.hotAlbums.filter( album => album.type === '专辑' && ['混音版', '精选集', 'Remix'].includes(album.subType) === false && album.size > 1 ) }, [albumsRaw?.hotAlbums]) const singles = useMemo(() => { if (!albumsRaw?.hotAlbums) return [] return albumsRaw.hotAlbums.filter( album => album.type !== '专辑' || ['混音版', '精选集', 'Remix'].includes(album.subType) || album.size === 1 ) }, [albumsRaw?.hotAlbums]) const latestAlbum = useMemo(() => { if (!albumsRaw || !albumsRaw.hotAlbums) return return albumsRaw.hotAlbums[0] }, [albumsRaw]) const coverImage = resizeImage(artist?.artist?.img1v1Url || '', 'md') return (