"use client"; import { Disc3, Music, Play, SkipForward, Square, Volume2 } from "lucide-react"; import { useMediaPlayer } from "@/lib/hooks/use-media-player"; export function MiniPlayer() { const { playing, current, queue, volume, pending, skip, stop, setVolume } = useMediaPlayer(); // Nothing to show if no track is playing and nothing is queued if (!current && queue.length === 0) return null; return (
{/* Track info */}
{playing ? ( ) : ( )}

{current?.title ?? "Unknown track"}

{queue.length > 0 && (

{queue.length > 1 ? `${queue.length} in queue` : "1 in queue"}

)}
{/* Controls */}
{playing && ( )} {current && ( )}
{/* Volume */}
setVolume(Number(e.target.value))} className="w-20 h-1 appearance-none rounded-full bg-glass-bg accent-primary cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:size-3 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary" aria-label="Volume" />
); }