"use client"; import { useState, useEffect, useCallback } from "react"; import { useRouter } from "next/navigation"; import { Search, Loader2, Music2, Link2, X, ChevronRight, Info } from "lucide-react"; import { api } from "@/lib/api"; import { useToast } from "@/lib/toast-context"; // Types interface PlaylistPreview { id: string; source: "deezer" | "spotify"; type: "playlist" | "radio"; title: string; description: string | null; creator: string; imageUrl: string | null; trackCount: number; url: string; } interface Genre { id: number; name: string; imageUrl: string | null; } // Deezer icon component const DeezerIcon = ({ className }: { className?: string }) => ( ); // Tab type (radios removed - now personal library content at /radio) type BrowseTab = "playlists" | "genres"; // Loading skeleton for cards const CardSkeleton = () => (
{item.trackCount} songs • {item.creator}
Discover and import playlists from Deezer
Beta feature:{" "} Importing from Spotify and Deezer relies on matching tracks through Soulseek and your configured indexers. Results may vary depending on track availability and metadata quality.
{loadError}
Try a different search or import a URL directly
No playlists found for this genre
) : (Showing {playlists.length} playlists • Search for more or import by URL
)} > )} {/* Genres Tab */} {activeTab === "genres" && ( <>Explore playlists organized by musical genre
Paste a link to get started
Example: https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M