import { useState } from "react"; import { Play, Pause, Music, ChevronDown, ChevronUp } from "lucide-react"; import { Card } from "@/components/ui/Card"; import { cn } from "@/utils/cn"; import { UnavailableAlbum } from "../types"; const tierColors: Record = { high: "text-green-400", medium: "text-yellow-400", explore: "text-orange-400", wildcard: "text-purple-400", // Legacy mappings low: "text-orange-400", wild: "text-purple-400", }; const tierLabels: Record = { high: "High Match", medium: "Medium Match", explore: "Explore", wildcard: "Wild Card", // Legacy mappings low: "Explore", wild: "Wild Card", }; interface UnavailableAlbumsProps { unavailable: UnavailableAlbum[]; currentPreview: string | null; onTogglePreview: (albumId: string, previewUrl: string) => void; } export function UnavailableAlbums({ unavailable, currentPreview, onTogglePreview, }: UnavailableAlbumsProps) { const [isExpanded, setIsExpanded] = useState(false); if (!unavailable || unavailable.length === 0) { return null; } return ( {isExpanded && ( <>

These albums were recommended but couldn't be found by your indexers. Listen to 30-second previews below!

{unavailable.map((album) => { const isPreviewPlaying = currentPreview === album.id; const attemptLabel = album.attemptNumber === 0 ? "Original Recommendation" : `Replacement #${album.attemptNumber}`; return (
0 && "pl-12 bg-[#1a1a1a]/30" )} >
{album.previewUrl ? ( ) : ( )}

{album.album}

{album.artist} {album.previewUrl && ( <> 30s Preview )}
{tierLabels[album.tier]}
{attemptLabel}
); })}
)}
); }