'use client'; import { motion, AnimatePresence } from 'framer-motion'; import { FaClock, FaTimes, FaDownload } from 'react-icons/fa'; import { Album, Purchase } from '@/lib/types'; interface PurchaseSuccessModalProps { show: boolean; album: Album | null; purchase: Purchase | null; onClose: () => void; } export default function PurchaseSuccessModal({ show, album, purchase, onClose }: PurchaseSuccessModalProps) { if (!album || !purchase) return null; const handleDownloadReceipt = () => { // Create a simple text receipt const receipt = ` PURCHASE RECEIPT ================ Status: PENDING APPROVAL Album: ${album.title} Artist: Parsa Amount: $${album.price} Transaction ID: ${purchase.transactionId} Date: ${new Date(purchase.purchaseDate).toLocaleString()} Tracks Included: ${album.songs.map((song, idx) => `${idx + 1}. ${song.title} (${song.duration})`).join('\n')} Thank you for your purchase! Your order is pending admin approval. You will receive access to this album after confirmation. `; const blob = new Blob([receipt], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `receipt-${purchase.transactionId}.txt`; document.body.appendChild(a); a.click(); document.body.removeChild(a); URL.revokeObjectURL(url); }; return ( {show && ( e.stopPropagation()} className="glass-effect rounded-2xl max-w-lg w-full p-8 border-2 border-accent-cyan/30" > {/* Header */}

Purchase Pending Approval

Please wait for admin confirmation

{/* Receipt Details */}
Album {album.title}
Artist Parsa
Tracks {album.songs.length} songs
Amount ${album.price}

Transaction ID

{purchase.transactionId}

{new Date(purchase.purchaseDate).toLocaleString()}

{/* Actions */}
OK, Got It
{/* Info */}

Your purchase will be reviewed by an admin. You will receive access after approval.

)}
); }