import { resizeImage } from '@/web/utils/common' import Image from '@/web/components/Image' import { cx, css } from '@emotion/css' import useAppleMusicArtist from '@/web/api/hooks/useAppleMusicArtist' import { useEffect } from 'react' import uiStates from '@/web/states/uiStates' import VideoCover from '@/web/components/VideoCover' const Cover = ({ artist }: { artist?: Artist }) => { const { data: artistFromApple, isLoading: isLoadingArtistFromApple } = useAppleMusicArtist( artist?.id || 0 ) const video = artistFromApple?.editorialVideo const cover = isLoadingArtistFromApple ? '' : artistFromApple?.artwork || artist?.img1v1Url || '' useEffect(() => { if (cover) uiStates.blurBackgroundImage = cover }, [cover]) return ( <>
{video && }
) } export default Cover