import { useAtomValue } from 'jotai/utils' import React from 'react' import { ActivityIndicator, View } from 'react-native' import FastImage from 'react-native-fast-image' import LinearGradient from 'react-native-linear-gradient' import { albumArtAtomFamily } from '@app/state/music' import colors from '@app/styles/colors' import CoverArt from '@app/components/CoverArt' interface AlbumArtProps { id: string height: number width: number } const AlbumArt: React.FC = ({ id, height, width }) => { const albumArt = useAtomValue(albumArtAtomFamily(id)) const Placeholder = () => ( ) return ( 128 ? albumArt?.uri : albumArt?.thumbUri} /> ) } const AlbumArtFallback: React.FC = ({ height, width }) => ( ) const AlbumArtLoader: React.FC = props => ( }> ) export default React.memo(AlbumArtLoader)