/* eslint-disable @typescript-eslint/no-explicit-any */ 'use client'; import { useEffect, useState } from 'react'; interface Song { id: string; name: string; artist: string; album?: string; pic?: string; platform: 'wy' | 'tx' | 'kw' | 'kg' | 'mg'; duration?: number; } interface MusicPlaylist { id: string; username: string; name: string; description?: string; cover?: string; created_at: number; updated_at: number; } interface AddToPlaylistModalProps { song: Song | null; isOpen: boolean; onClose: () => void; onSuccess?: () => void; onError?: (message: string) => void; } function getApiErrorMessage(error: unknown, fallback: string): string { if (typeof error === 'string') return error; if (error && typeof error === 'object' && 'message' in error) { const message = (error as { message?: unknown }).message; if (typeof message === 'string' && message.trim()) return message; } return fallback; } function MusicLoadingIndicator({ text, size = 'md', className = '', }: { text?: string; size?: 'sm' | 'md'; className?: string; }) { const iconSize = size === 'sm' ? 'w-4 h-4' : 'w-5 h-5'; const textSize = size === 'sm' ? 'text-xs' : 'text-sm'; return ( <>