'use client'
import type { Track } from './music-provider'
import { useOffline } from '@/lib/stores/offline'
import { Download, Loader2, CheckCircle, Clock } from 'lucide-react'
interface DownloadButtonProps {
track: Track
className?: string
size?: 'sm' | 'md'
}
export function DownloadButton({ track, className = '', size = 'sm' }: DownloadButtonProps) {
const { offlineIds, download, remove, getStatus } = useOffline()
const isOffline = offlineIds.has(track.id)
const status = getStatus(track.id)
const iconSize = size === 'sm' ? 'h-4 w-4' : 'h-5 w-5'
const padding = size === 'sm' ? 'p-1.5' : 'p-2'
if (isOffline) {
return (
)
}
if (status === 'downloading') {
return (
)
}
if (status === 'queued') {
return (
)
}
return (
)
}