'use client'; import React, { useState } from 'react'; import { Heart, CheckCircle } from 'lucide-react'; import type { Campaign } from '@/lib/api'; const AMOUNTS = [10, 25, 50, 100, 250]; export default function DonationCard({ campaign }: { campaign: Campaign }) { const [selected, setSelected] = useState(25); const [custom, setCustom] = useState(''); const [donated, setDonated] = useState(false); const pct = Math.min(100, Math.round((campaign.raised / campaign.goal) * 100)); const handleDonate = () => { // Stripe would go here setDonated(true); setTimeout(() => setDonated(false), 3000); }; return (

{campaign.title}

{campaign.description}

{/* Progress */}
${campaign.raised.toLocaleString()} raised Goal: ${campaign.goal.toLocaleString()}

{pct}% complete

{/* Amount selector */}
{AMOUNTS.map((amt) => ( ))}
{ setCustom(e.target.value); setSelected(0); }} placeholder="Custom amount" className="w-full bg-black/40 border border-white/10 rounded-lg px-4 py-2.5 text-sm text-white placeholder:text-stone-600 focus:outline-none focus:border-teal/50" />
); }