import { memo } from 'react' import ArtistInline from '@/renderer/components/ArtistsInline' import Skeleton from '@/renderer/components/Skeleton' import SvgIcon from '@/renderer/components/SvgIcon' import useUserLikedTracksIDs, { useMutationLikeATrack, } from '@/renderer/hooks/useUserLikedTracksIDs' import { player } from '@/renderer/store' import { formatDuration } from '@/renderer/utils/common' import { State as PlayerState } from '@/renderer/utils/player' const PlayOrPauseButtonInTrack = memo( ({ isHighlight, trackID }: { isHighlight: boolean; trackID: number }) => { const playerSnapshot = useSnapshot(player) const isPlaying = useMemo( () => playerSnapshot.state === PlayerState.Playing, [playerSnapshot.state] ) const onClick = () => { isHighlight ? player.playOrPause() : player.playTrack(trackID) } return (