import React from 'react'; import { useLocale } from '@/os/locale'; import { useSearchParams } from 'react-router-dom'; import { IcPlay, IcPause, IcMic, IcAddCircle, IcLikedIndicator } from '../res/icons'; import { useSpotifyStore, selectLikedSongIds } from '../state'; import { useSpotifyGestures } from '../hooks/useSpotifyGestures'; import { useShallow } from 'zustand/react/shallow'; import { localizeSpotifyText } from '../utils/localizeSpotifyText'; import { openSaveLocation } from './LikedToast'; export const BottomPlayer: React.FC = () => { const locale = useLocale(); const isEnglish = locale === 'en'; const [, setSearchParams] = useSearchParams(); const { currentTrack, isPlaying } = useSpotifyStore(useShallow(s => ({ currentTrack: s.currentTrack, isPlaying: s.isPlaying }))); const togglePlay = useSpotifyStore(s => s.togglePlay); const toggleLike = useSpotifyStore(s => s.toggleLike); const likedSongIds = useSpotifyStore(selectLikedSongIds); const isLiked = (trackId: string, track?: { title: string; artist: string }) => likedSongIds.has(trackId, track); const { bindTap } = useSpotifyGestures(); if (!currentTrack) return null; const liked = isLiked(currentTrack.id, currentTrack); const displayText = (value: string | undefined) => localizeSpotifyText(value, isEnglish); return (