"use client"; import Link from "next/link"; import Image from "next/image"; import { Music } from "lucide-react"; import { api } from "@/lib/api"; import { memo } from "react"; interface MixCardProps { mix: { id: string; name: string; description: string; coverUrls: string[]; trackCount: number; }; index?: number; } const MixCard = memo( function MixCard({ mix, index }: MixCardProps) { return (
{/* Circular mosaic cover art */}
{mix.coverUrls.length > 0 ? (
{mix.coverUrls.slice(0, 4).map((url, idx) => { const proxiedUrl = api.getCoverArtUrl(url, 300); return (
); })} {/* Fill remaining cells if less than 4 covers */} {Array.from({ length: Math.max(0, 4 - mix.coverUrls.length), }).map((_, idx) => (
))}
) : (
)}

{mix.name}

{mix.description}

); }, (prevProps, nextProps) => { return prevProps.mix.id === nextProps.mix.id; } ); export { MixCard };