/** * Composant MiniPlayer * Version compacte du player avec position fixe et toggle */ import { ChevronUp, X } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Tooltip } from '@/components/ui/tooltip'; import { usePlayer } from '../hooks/usePlayer'; import { TrackInfo } from './TrackInfo'; import { PlayPauseButton } from './PlayPauseButton'; import { NextPreviousButtons } from './NextPreviousButtons'; import { ProgressBar } from './ProgressBar'; import { VolumeControl } from './VolumeControl'; export interface MiniPlayerProps { isVisible: boolean; onToggle: () => void; onClose?: () => void; className?: string; position?: 'bottom' | 'top'; } export function MiniPlayer({ isVisible, onToggle, onClose, className, position = 'bottom', }: MiniPlayerProps) { const player = usePlayer(); if (!isVisible || !player.currentTrack) { return null; } const handlePlayPause = () => { if (player.isPlaying) { player.pause(); } else { player.resume(); } }; const canGoNext = player.queue.length > 0 && player.currentIndex < player.queue.length - 1; const canGoPrevious = player.queue.length > 0 && player.currentIndex > 0; return (
{/* Track Info - Compact */}
{/* Progress Bar - Compact */}
{/* Controls */}
{/* Toggle Button */} {/* Close Button (optional) */} {onClose && ( )}
); } export default MiniPlayer;