import { ScrollArea } from '@/components/ui/scroll-area' import { Badge } from '@/components/ui/badge' import { Music, Play } from 'lucide-react' import { type PlayerPlaylist } from '@/lib/api/services/player' import { filesService } from '@/lib/api/services/files' import { cn } from '@/lib/utils' import { formatDuration } from '@/utils/format-duration' interface PlaylistProps { playlist: PlayerPlaylist currentIndex?: number onTrackSelect: (index: number) => void variant?: 'normal' | 'maximized' } export function Playlist({ playlist, currentIndex, onTrackSelect, variant = 'normal' }: PlaylistProps) { return (
{/* Header */}

{playlist.name}

{playlist.sounds.length} tracks
{/* Track List */}
{playlist.sounds.map((sound, index) => (
onTrackSelect(index)} > {/* Track number/play icon - 1 column */}
{currentIndex === index ? ( ) : ( {index + 1} )}
{/* Thumbnail - 1 column */}
{sound.thumbnail ? ( ) : ( )}
{/* Track name - 6 columns (takes most space) */}
{sound.name}
{/* Duration - 2 columns */}
{formatDuration(sound.duration)}
))}
{/* Footer Stats */}
{playlist.sounds.length} tracks {formatDuration(playlist.duration)}
) }