import { player } from '@/web/store' import { resizeImage } from '@/web/utils/common' import Icon from './Icon' import ArtistInline from './ArtistsInline' import { State as PlayerState, Mode as PlayerMode } from '@/web/utils/player' import useCoverColor from '../hooks/useCoverColor' import { cx } from '@emotion/css' import { useNavigate } from 'react-router-dom' import { useSnapshot } from 'valtio' import { useMemo } from 'react' const MediaControls = () => { const classes = 'btn-pressed-animation btn-hover-animation mr-1 cursor-default rounded-lg p-1.5 transition duration-200 after:bg-white/10' const playerSnapshot = useSnapshot(player) const state = useMemo(() => playerSnapshot.state, [playerSnapshot.state]) const playOrPause = () => { if (playerSnapshot.mode === PlayerMode.FM) { player.playOrPause() } else { player.playFM() } } return (