import useIsMobile from '@/web/hooks/useIsMobile'
import useAppleMusicArtist from '@/web/hooks/useAppleMusicArtist'
import { cx, css } from '@emotion/css'
const ArtistInfo = ({
artist,
isLoading,
}: {
artist?: Artist
isLoading: boolean
}) => {
const isMobile = useIsMobile()
const { data: artistFromApple, isLoading: isLoadingArtistFromApple } =
useAppleMusicArtist({
id: artist?.id,
name: artist?.name,
})
return (
{/* Name */}
{isLoading ? (
PLACEHOLDER
) : (
{artist?.name}
)}
{/* Type */}
{isLoading ? (
Artist
) : (
Artist
)}
{/* Counts */}
{isLoading ? (
PLACEHOLDER12345
) : (
{artist?.musicSize} Tracks · {artist?.albumSize} Albums ·{' '}
{artist?.mvSize} Videos
)}
{/* Description */}
{!isMobile &&
(isLoading || isLoadingArtistFromApple ? (
PLACEHOLDER1234567890
) : (
{artistFromApple?.attributes?.artistBio || artist?.briefDesc}
))}
)
}
export default ArtistInfo