import React, { useState } from 'react'; import { Minimize2 } from 'lucide-react'; import { Button } from '../ui/button'; import { useAudio } from '../../context/AudioContext'; import { PlayerControls } from './PlayerControls'; import { LyricsPanel } from './LyricsPanel'; import { WaveformVisualizer } from '../ui/WaveformVisualizer'; interface FullPlayerProps { onClose: () => void; } export const FullPlayer: React.FC = ({ onClose }) => { const { currentTrack, currentTime, duration, progress, seek, visualizerSettings, } = useAudio(); const [showLyrics, setShowLyrics] = useState(false); if (!currentTrack) return null; const formatTime = (seconds: number) => { const mins = Math.floor(seconds / 60); const secs = Math.floor(seconds % 60); return `${mins}:${secs < 10 ? '0' : ''}${secs}`; }; const handleSeek = (e: React.MouseEvent) => { const rect = e.currentTarget.getBoundingClientRect(); const x = e.clientX - rect.left; const p = Math.max(0, Math.min(100, (x / rect.width) * 100)); seek(p); }; return (
{/* Ambient Backdrop */}
{/* Header */}
LOSSLESS
{/* Main Content */}
{/* Left: Artwork & Metadata */}
setShowLyrics(!showLyrics)} > {/* Visualizer Overlay if enabled */} {visualizerSettings.mode !== 'off' && (
{showLyrics ? 'Hide Lyrics' : 'Show Lyrics'}
)}

{currentTrack.title}

{currentTrack.artist}

{currentTrack.album} • {currentTrack.genre}

{/* Right: Lyrics View */} {showLyrics && (
)}
{/* Controls & Waveform */}
{formatTime(currentTime)} {formatTime(duration)}
{/* Seek Bar / Waveform */}
{visualizerSettings.mode === 'waveform' ? ( ) : (
)}
); };