"use client" import { Play } from "lucide-react" import type { PlayerTrack } from "@/lib/types" import { formatDuration } from "@/lib/utils" import { usePlayerStore } from "@/store/player-store" interface TrackListProps { tracks: PlayerTrack[] showArtwork?: boolean } export const TrackList = ({ tracks, showArtwork = false }: TrackListProps) => { const currentTrack = usePlayerStore((state) => state.currentTrack) const isPlaying = usePlayerStore((state) => state.isPlaying) const { loadAndPlayQueue } = usePlayerStore((state) => state.actions) const handleTrackClick = (index: number) => { loadAndPlayQueue(tracks, index) } return (
{tracks.map((track, index) => { const isCurrentTrack = currentTrack?.id === track.id const isActive = isCurrentTrack && isPlaying return ( ) })}
) }