import { useState } from "react"; const tiers = [ { name: "Bronze", icon: "ri-medal-line", color: "#cd7f32", bg: "#cd7f3215", border: "#cd7f3230", referrals: "1–4 referrals", bonus: "5%", perInvestor: "Up to $250/referral", perks: ["5% of referee's first deposit", "Dashboard access", "Email support"], }, { name: "Silver", icon: "ri-medal-2-line", color: "#9ca3af", bg: "#9ca3af15", border: "#9ca3af30", referrals: "5–14 referrals", bonus: "8%", perInvestor: "Up to $400/referral", perks: ["8% of referee's first deposit", "Priority payouts", "Dedicated manager"], }, { name: "Gold", icon: "ri-trophy-line", color: "#f59e0b", bg: "#f59e0b15", border: "#f59e0b35", referrals: "15–29 referrals", bonus: "12%", perInvestor: "Up to $600/referral", perks: ["12% of referee's first deposit", "VIP withdrawals", "Weekly bonus payouts"], featured: true, }, { name: "Platinum", icon: "ri-vip-crown-line", color: "#e879f9", bg: "#e879f915", border: "#e879f930", referrals: "30+ referrals", bonus: "15%", perInvestor: "Unlimited earnings", perks: ["15% of referee's first deposit", "Lifetime commissions", "Exclusive VIP events"], }, ]; const stats = [ { label: "Total Referral Payouts", value: "$1.2M+", icon: "ri-money-dollar-circle-line", color: "#f59e0b" }, { label: "Active Referrers", value: "8,400+", icon: "ri-group-line", color: "#10b981" }, { label: "Avg. Referral Earning", value: "$320", icon: "ri-line-chart-line", color: "#e879f9" }, { label: "Max Single Referral", value: "$7,500", icon: "ri-trophy-line", color: "#f59e0b" }, ]; const steps = [ { num: "01", icon: "ri-user-add-line", color: "#f59e0b", title: "Sign Up & Get Your Link", desc: "Register below and receive your unique referral link instantly — shareable anywhere." }, { num: "02", icon: "ri-share-line", color: "#10b981", title: "Share with Friends", desc: "Post your link on social media, WhatsApp, Telegram or email to your network." }, { num: "03", icon: "ri-money-dollar-circle-line", color: "#e879f9", title: "Earn on Every Deposit", desc: "Get paid automatically when your referrals invest — up to 15% commission per deposit." }, ]; const topReferrers = [ { name: "Marcus T.", location: "Dubai", earned: "$14,200", referrals: 47, avatar: "https://readdy.ai/api/search-image?query=professional%20confident%20young%20man%20headshot%20portrait%20dark%20background%20studio%20lighting%20clean%20minimal&width=80&height=80&seq=ref001&orientation=squarish" }, { name: "Priya S.", location: "Singapore", earned: "$9,850", referrals: 31, avatar: "https://readdy.ai/api/search-image?query=professional%20woman%20headshot%20portrait%20smiling%20dark%20background%20studio%20lighting%20minimal%20clean&width=80&height=80&seq=ref002&orientation=squarish" }, { name: "Carlos M.", location: "Mexico City", earned: "$7,600", referrals: 24, avatar: "https://readdy.ai/api/search-image?query=professional%20businessman%20headshot%20portrait%20dark%20background%20studio%20lighting%20minimal&width=80&height=80&seq=ref003&orientation=squarish" }, { name: "Aisha K.", location: "London", earned: "$6,300", referrals: 20, avatar: "https://readdy.ai/api/search-image?query=professional%20young%20woman%20smiling%20headshot%20dark%20background%20studio%20clean&width=80&height=80&seq=ref004&orientation=squarish" }, { name: "Liam W.", location: "Sydney", earned: "$5,100", referrals: 17, avatar: "https://readdy.ai/api/search-image?query=confident%20young%20professional%20man%20headshot%20dark%20background%20studio%20portrait&width=80&height=80&seq=ref005&orientation=squarish" }, ]; export default function ReferralSection() { const [submitted, setSubmitted] = useState(false); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(""); const [generatedLink, setGeneratedLink] = useState(""); const [linkCopied, setLinkCopied] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(""); const form = e.currentTarget; const data = new FormData(form); const body = new URLSearchParams(); data.forEach((val, key) => body.append(key, val as string)); setSubmitting(true); try { const res = await fetch("https://readdy.ai/api/form/d72h3b2aegmdqoca7ua0", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString(), }); if (res.ok) { const username = (data.get("full_name") as string)?.toLowerCase().replace(/\s+/g, "") || "user"; setGeneratedLink(`https://cryptovault.io/ref/${username}${Math.floor(1000 + Math.random() * 9000)}`); setSubmitted(true); form.reset(); } else { setError("Submission failed. Please try again."); } } catch { setError("Network error. Please check your connection."); } finally { setSubmitting(false); } }; const handleCopyLink = () => { navigator.clipboard.writeText(generatedLink).then(() => { setLinkCopied(true); setTimeout(() => setLinkCopied(false), 2000); }); }; return (
{/* Ambient glow */}
{/* Header */}
Referral Program

Earn While You Sleep

Invite friends to Crypto Vault and earn up to 15% commission on every deposit they make — forever, with no cap on earnings.

{/* Stats row */}
{stats.map((s, i) => (

{s.value}

{s.label}

))}
{/* How it works */}

How It Works

{/* Connector line */}
{steps.map((step) => (
STEP {step.num}

{step.title}

{step.desc}

))}
{/* Tier cards */}

Commission Tiers

The more people you refer, the higher your commission rate climbs

{tiers.map((tier) => (
{tier.featured && (
★ Most Popular
)}

{tier.name}

{tier.referrals}

{/* Big ROI */}
{tier.bonus}

Commission per deposit

{tier.perInvestor}

    {tier.perks.map((perk) => (
  • {perk}
  • ))}
))}
{/* Two-col: top earners + signup form */}
{/* Top Referrers Leaderboard */}

Top Earners This Month

Real investors, real commissions

{topReferrers.map((r, i) => (
{/* Rank */} {i + 1} {/* Avatar */}
{r.name}
{/* Info */}

{r.name}

{r.location} · {r.referrals} referrals

{/* Earned */} {r.earned}
))}
{/* Testimonial */}

"I referred 12 friends last month and made over $4,200 in commissions without investing a single dollar myself."

— Marcus T., Dubai · Gold Tier

{/* Signup Form */}

Join the Referral Program

Get your unique link in seconds

{submitted ? (

You're In! 🎉

Welcome to the Crypto Vault referral program! Share your unique link and start earning commissions.

{/* Generated link box */}

Your Referral Link

{generatedLink}

{/* Share buttons */}
{[ { icon: "ri-telegram-line", label: "Telegram", color: "#0088cc" }, { icon: "ri-whatsapp-line", label: "WhatsApp", color: "#25d366" }, { icon: "ri-twitter-x-line", label: "Twitter/X", color: "#ffffff" }, ].map((s) => ( ))}
) : (
{/* Name */}
{/* Email */}
{/* Country */}
{/* How will you promote */}
{/* Referral code (optional) */}
{/* Perks highlight */}
{["5%–15% commission", "Instant payouts", "No earnings cap", "Free to join"].map((perk) => ( {perk} ))}
{error && (

{error}

)} )}
); }