import useIsMobile from '@/web/hooks/useIsMobile'
import useAppleMusicArtist from '@/web/hooks/useAppleMusicArtist'
import { cx, css } from '@emotion/css'
import { useTranslation } from 'react-i18next'
const ArtistInfo = ({
artist,
isLoading,
}: {
artist?: Artist
isLoading: boolean
}) => {
const { t } = useTranslation()
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
) : (
{t('common.track-with-count', { count: artist?.musicSize })} ·{' '}
{t('common.album-with-count', { count: artist?.albumSize })} ·{' '}
{t('common.video-with-count', { count: artist?.mvSize })}
)}
{/* Description */}
{!isMobile &&
(isLoading || isLoadingArtistFromApple ? (
PLACEHOLDER1234567890
) : (
{artistFromApple?.attributes?.artistBio || artist?.briefDesc}
))}
)
}
export default ArtistInfo