import Player from './Player' import { player, state } from '@/renderer/store' import { getCoverColor } from '@/renderer/utils/common' import { colord } from 'colord' import IconButton from '../IconButton' import SvgIcon from '../SvgIcon' import Lyric from './Lyric' import { motion, AnimatePresence } from 'framer-motion' import Lyric2 from './Lyric2' const LyricPanel = () => { const stateSnapshot = useSnapshot(state) const playerSnapshot = useSnapshot(player) const track = useMemo(() => playerSnapshot.track, [playerSnapshot.track]) const [bgColor, setBgColor] = useState({ from: '#222', to: '#222' }) useEffect(() => { getCoverColor(track?.al?.picUrl || '').then(color => { if (!color) return const to = colord(color).darken(0.15).rotate(-5).toHex() setBgColor({ from: color, to }) }) }, [track?.al?.picUrl]) return ( {stateSnapshot.uiStates.showLyricPanel && ( {/* Drag area */}
{/* */}
(state.uiStates.showLyricPanel = false)}>
)}
) } export default LyricPanel