import { Play, Pause, SkipBack, SkipForward, Volume2, ListMusic, Shuffle, Repeat, Repeat1, MicVocal, ThumbsDown } from 'lucide-react'; import { Link } from '@tanstack/react-router'; import { usePlaybackStore } from '../store/usePlaybackStore'; import { useDislikeTrack } from '../hooks/useDislikeTrack'; import { Artwork } from './Artwork'; import { ArtistLinks } from './ArtistLinks'; import { formatDuration } from './TrackRow'; import { DevicePicker } from './DevicePicker'; import { usePlaybackSyncContext } from './PlaybackSyncProvider'; interface PlaybackBarProps { queueOpen: boolean; lyricsOpen: boolean; onToggleQueue: () => void; onToggleLyrics: () => void; } export function PlaybackBar({ queueOpen, lyricsOpen, onToggleQueue, onToggleLyrics }: PlaybackBarProps) { const { currentTrack, isPlaying, position, duration, volume, shuffle, repeat, play, pause, next, prev, setPosition, setVolume, toggleShuffle, cycleRepeat } = usePlaybackStore(); const dislikeTrack = useDislikeTrack(); const { hasRemoteOwner, sendCommand } = usePlaybackSyncContext(); // While another device holds the audio, the transport is a remote: the press // travels to that device instead of starting a second stream here. const remote = { play: () => (hasRemoteOwner ? void sendCommand({ type: 'play' }) : play()), pause: () => (hasRemoteOwner ? void sendCommand({ type: 'pause' }) : pause()), next: () => (hasRemoteOwner ? void sendCommand({ type: 'next' }) : next()), prev: () => (hasRemoteOwner ? void sendCommand({ type: 'prev' }) : prev()), seek: (seconds: number) => hasRemoteOwner ? void sendCommand({ type: 'seek', position: seconds }) : setPosition(seconds), }; const handleDislike = () => { if (!currentTrack) return; dislikeTrack(currentTrack.id); }; return (