import { useNavigation } from '@react-navigation/native' import { useAtomValue } from 'jotai/utils' import React, { useEffect } from 'react' import { ActivityIndicator, GestureResponderEvent, StyleSheet, Text, View } from 'react-native' import IconFA from 'react-native-vector-icons/FontAwesome' import IconMat from 'react-native-vector-icons/MaterialIcons' import { albumAtomFamily } from '@app/state/music' import { currentTrackAtom, useSetQueue } from '@app/state/trackplayer' import colors from '@app/styles/colors' import font from '@app/styles/font' import Button from '@app/components/Button' import GradientBackground from '@app/components/GradientBackground' import ImageGradientScrollView from '@app/components/ImageGradientScrollView' import PressableOpacity from '@app/components/PressableOpacity' import CoverArt from '@app/components/CoverArt' const SongItem: React.FC<{ id: string title: string artist?: string track?: number onPress: (event: GestureResponderEvent) => void }> = ({ id, title, artist, onPress }) => { const currentTrack = useAtomValue(currentTrackAtom) return ( {title} {artist} ) } const songStyles = StyleSheet.create({ container: { marginTop: 20, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }, text: { flex: 1, alignItems: 'flex-start', width: 100, }, title: { fontSize: 16, fontFamily: font.semiBold, }, subtitle: { fontSize: 14, fontFamily: font.regular, color: colors.text.secondary, }, controls: { flexDirection: 'row', alignItems: 'center', marginLeft: 10, }, more: { marginLeft: 8, }, }) const AlbumDetails: React.FC<{ id: string }> = ({ id }) => { const album = useAtomValue(albumAtomFamily(id)) const setQueue = useSetQueue() if (!album) { return <> } return ( {album.name} {album.artist} {album.year ? ` • ${album.year}` : ''}