"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { api } from "@/lib/api"; import { useAuth } from "@/lib/auth-context"; import { Music } from "lucide-react"; import { GradientSpinner } from "@/components/ui/GradientSpinner"; export default function ArtistsPage() { const { isAuthenticated } = useAuth(); const [artists, setArtists] = useState([]); const [isLoading, setIsLoading] = useState(true); useEffect(() => { const loadArtists = async () => { if (!isAuthenticated) return; try { const data = await api.getArtists({ limit: 200 }); setArtists(data.artists); } catch (error) { console.error("Failed to load artists:", error); } finally { setIsLoading(false); } }; loadArtists(); }, [isAuthenticated]); if (isLoading) { return (
); } return (
{/* Extended gradient background that fades from hero into content */}
{/* Hero Section */}

All Artists

{artists.length} artists in your library

{artists.map((artist) => (
{artist.coverArt ? ( {artist.name} ) : ( )}

{artist.name}

{artist.albumCount || 0} albums

))}
); }