import { Image } from "expo-image"; import { FC } from "react"; import { Pressable, Text, View } from "react-native"; import Track from "../Icons/Track"; export type SongProps = { size?: number; artist: string; title: string; image?: string; listenerAvatar?: string; listenerHandle?: string; listeningDate?: string; className?: string; rank?: number; borderRadius?: number; did: string; albumUri: string; onPress: (did: string) => void; onPressAlbum: (albumDid: string) => void; onOpenProfile?: (didOrHandle: string) => void; withoutAlbumCover?: boolean; }; const Song: FC = (props) => { const { size, artist, title, image, listenerHandle, className, rank, borderRadius, listeningDate, did, albumUri, onPress, onOpenProfile, onPressAlbum, withoutAlbumCover, } = props; const imageSize = size ? size : 80; return ( {rank && ( {rank} )} {!withoutAlbumCover && ( onPressAlbum(albumUri)}> {image && ( )} {!image && } )} onPress(did)}> {title} {listeningDate && ( {listeningDate} )} onPress(did)}> {artist} {listenerHandle && ( onOpenProfile!(listenerHandle)}> @{listenerHandle} )} ); }; export default Song;