This commit is contained in:
danis
2023-09-22 15:50:26 +02:00
parent 0b0fd0585d
commit 2d90c6eec1

View File

@@ -12,24 +12,24 @@ type SongRowProps = {
};
type DurationInfoProps = {
length: number;
}
length: number;
};
const DurationInfo = ({length}: DurationInfoProps) => {
const minutes = Math.floor(length / 60);
const seconds = Math.round(length - minutes * 60);
const DurationInfo = ({ length }: DurationInfoProps) => {
const minutes = Math.floor(length / 60);
const seconds = Math.round(length - minutes * 60);
return (
<Text
style={{
flexShrink: 0,
}}
fontSize={'sm'}
>
{`${minutes}'${seconds}` ?? '--.--'}
</Text>
);
}
return (
<Text
style={{
flexShrink: 0,
}}
fontSize={'sm'}
>
{`${minutes}'${seconds}` ?? '--.--'}
</Text>
);
};
const SongRow = ({ song, onPress, handleLike, isLiked }: SongRowProps) => {
return (
@@ -75,7 +75,7 @@ const SongRow = ({ song, onPress, handleLike, isLiked }: SongRowProps) => {
>
{song.artistId ?? 'artist'}
</Text>
<DurationInfo length={song.details.length}/>
<DurationInfo length={song.details.length} />
</HStack>
<IconButton
colorScheme="rose"