import { HStack, IconButton, Image, Text } from 'native-base'; import Song, { SongWithArtist } from '../models/Song'; import RowCustom from './RowCustom'; import TextButton from './TextButton'; import { MaterialIcons } from '@expo/vector-icons'; type SongRowProps = { song: Song | SongWithArtist; // TODO: remove Song isLiked: boolean; onPress: () => void; handleLike: (state: boolean, songId: number) => Promise; }; const SongRow = ({ song, onPress, handleLike, isLiked }: SongRowProps) => { return ( {song.name} {song.name} {song.artistId ?? 'artist'} { await handleLike(isLiked, song.id); }} _icon={{ as: MaterialIcons, name: isLiked ? 'favorite-outline' : 'favorite', }} /> ); }; export default SongRow;