Spaces:
Paused
Paused
CBV01
feat: scale indexes, discrete scrollbar, viewport payment modal, avatar persistence, simple dashboard english, plan limits card, and live smtp verification
504c45c Download frontend/src/components/MonetizationOverlay.tsx from adekolateam/arkitel: direct link, hf CLI and curl.
- Browser
- Download file 89.7 kB
-
https://huggingface.co/spaces/adekolateam/arkitel/resolve/main/frontend/src/components/MonetizationOverlay.tsx
- Command line
-
hf download hf://spaces/adekolateam/arkitel/frontend/src/components/MonetizationOverlay.tsx
-
curl -L -o MonetizationOverlay.tsx https://huggingface.co/spaces/adekolateam/arkitel/resolve/main/frontend/src/components/MonetizationOverlay.tsx
89.7 kB
'use client';
import React, { useState, useEffect } from 'react';
import { apiFetch } from '@/lib/auth';
import {
Lock, CreditCard, CheckCircle2, X, AlertCircle,
Zap, Star, Crown, Copy, Check, ExternalLink, ShieldCheck,
Building2, Coins, ArrowRight, MessageCircle, Globe,
ArrowLeft, Mail, Clock, Sparkles, Send, Upload, FileText
} from 'lucide-react';
interface MonetizationOverlayProps {
children: React.ReactNode;
featureName: string;
}
const WHATSAPP_PHONE = "2348107791177";
const SUPPORT_EMAIL = "arkilostudios@gmail.com";
const PLAN_METADATA: Record<string, {
icon: any;
tag: string;
headline: string;
popular?: boolean;
}> = {
basic: {
icon: Zap,
tag: 'Starter',
headline: 'Ideal for solo operators & small tests'
},
standard: {
icon: Star,
tag: 'Most Popular',
headline: 'High-volume engine for serious campaigns',
popular: true
},
premium: {
icon: Crown,
tag: 'Enterprise',
headline: 'Maximum scale with unrestricted power'
},
};
// Accurate baseline exchange conversion rates from NGN (base)
const EXCHANGE_RATES: Record<string, number> = {
NGN: 1,
USD: 1 / 1500,
EUR: 1 / 1650,
GBP: 1 / 1950,
USDT: 1 / 1500,
BTC: (1 / 1500) / 65000,
SOL: (1 / 1500) / 150,
};
// Circular Flag / Currency Badge Component (Renders real vibrant flags on all OS including Windows)
const CurrencyFlag: React.FC<{ currency: string }> = ({ currency }) => {
switch (currency) {
case 'NGN':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="12" height="36" fill="#008751" />
<rect x="12" width="12" height="36" fill="#FFFFFF" />
<rect x="24" width="12" height="36" fill="#008751" />
</svg>
</span>
);
case 'USD':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#B22234" />
<path d="M0,5 h36 M0,11 h36 M0,16 h36 M0,21 h36 M0,27 h36 M0,32 h36" stroke="#FFFFFF" strokeWidth="2.5" />
<rect width="16" height="18" fill="#3C3B6E" />
<circle cx="8" cy="9" r="3.5" fill="#FFFFFF" />
</svg>
</span>
);
case 'GBP':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#012169" />
<path d="M0,0 L36,36 M36,0 L0,36" stroke="#FFFFFF" strokeWidth="5" />
<path d="M0,0 L36,36 M36,0 L0,36" stroke="#C8102E" strokeWidth="2.5" />
<path d="M18,0 V36 M0,18 H36" stroke="#FFFFFF" strokeWidth="7" />
<path d="M18,0 V36 M0,18 H36" stroke="#C8102E" strokeWidth="4" />
</svg>
</span>
);
case 'EUR':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#003399" />
<circle cx="18" cy="6" r="1.5" fill="#FFCC00" />
<circle cx="18" cy="30" r="1.5" fill="#FFCC00" />
<circle cx="6" cy="18" r="1.5" fill="#FFCC00" />
<circle cx="30" cy="18" r="1.5" fill="#FFCC00" />
<circle cx="10" cy="10" r="1.5" fill="#FFCC00" />
<circle cx="26" cy="10" r="1.5" fill="#FFCC00" />
<circle cx="10" cy="26" r="1.5" fill="#FFCC00" />
<circle cx="26" cy="26" r="1.5" fill="#FFCC00" />
</svg>
</span>
);
case 'USDT':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex items-center justify-center bg-[#26A17B] text-white font-bold text-xs shadow-sm">
₮
</span>
);
case 'BTC':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex items-center justify-center bg-[#F7931A] text-white font-bold text-xs shadow-sm">
₿
</span>
);
case 'SOL':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex items-center justify-center bg-gradient-to-tr from-[#9945FF] to-[#14F195] text-white font-bold text-xs shadow-sm">
◎
</span>
);
default:
return <Globe size={18} className="text-slate-400" />;
}
};
// Exact Bank Details requested by User
const BANK_ACCOUNTS: Record<string, {
currency: string;
label: string;
symbol: string;
sublabel: string;
details: { label: string; value: string; isPrimary?: boolean }[];
}> = {
NGN: {
currency: 'NGN',
label: 'Nigerian Naira (NGN)',
sublabel: 'Instant Local Bank Transfer',
symbol: '₦',
details: [
{ label: 'Bank Name', value: 'PAGA' },
{ label: 'Account Name', value: 'Ademola Adeleye' },
{ label: 'Account Number', value: '1391953270', isPrimary: true }
]
},
USD: {
currency: 'USD',
label: 'United States Dollar (USD)',
sublabel: 'Fedwire / ACH Domestic & International',
symbol: '$',
details: [
{ label: 'Bank Name', value: 'Lead Bank' },
{ label: 'Account Name', value: 'Ademola Victor Adeleye' },
{ label: 'Account Number', value: '216157536315', isPrimary: true },
{ label: 'Routing Number (ABA)', value: '101019644' },
{ label: 'Account Type', value: 'Personal Checking' },
{ label: 'Bank Address', value: '9450 Southwest Gemini Drive, Beaverton, OR, 97008, USA' }
]
},
GBP: {
currency: 'GBP',
label: 'British Pound (GBP)',
sublabel: 'Faster Payments / BACS Sort Code',
symbol: '£',
details: [
{ label: 'Bank Name', value: 'Banking Circle S.A.' },
{ label: 'Account Name', value: 'Bridge Building S.A.' },
{ label: 'Account Number', value: '49412630', isPrimary: true },
{ label: 'Sort Code', value: '608382' },
{ label: 'Account Type', value: 'Business' },
{ label: 'Bank Address', value: '2 Boulevard de la Foire, L-1528 Luxembourg' }
]
},
EUR: {
currency: 'EUR',
label: 'Euro (EUR)',
sublabel: 'SEPA Direct Credit Transfer & Wire',
symbol: '€',
details: [
{ label: 'Bank Name', value: 'Banking Circle S.A.' },
{ label: 'Account Name', value: 'Ademola Victor Adeleye' },
{ label: 'Account Number / IBAN', value: 'LU644080000074755809', isPrimary: true },
{ label: 'SWIFT / BIC Code', value: 'BCIRLULL' },
{ label: 'Account Type', value: 'Personal' },
{ label: 'Bank Address', value: '2 Boulevard de la Foire, L-1528 Luxembourg' }
]
}
};
// Exact Crypto Details requested by User
const CRYPTO_WALLETS: Record<string, {
key: string;
name: string;
symbol: string;
network: string;
address: string;
}> = {
USDT: {
key: 'USDT',
name: 'Tether USDT',
symbol: 'USDT',
network: 'TRON (TRC20)',
address: 'TCNaMTfadY1KePJ5sVrbu2evFZ9Zu5nfaQ',
},
BTC: {
key: 'BTC',
name: 'Bitcoin',
symbol: 'BTC',
network: 'Bitcoin Native',
address: '1LWf9VhzTsV1aSjd5oJJ152E4wNmkt4XFc',
},
SOL: {
key: 'SOL',
name: 'Solana',
symbol: 'SOL',
network: 'Solana Mainnet',
address: '3fMAT91KZfQAmU8FEEPEYpS1ZxKyDzqg6DtJQoQcJai9',
}
};
export const MonetizationOverlay: React.FC<MonetizationOverlayProps> = ({ children, featureName }) => {
const [status, setStatus] = useState<any>(null);
const [plans, setPlans] = useState<any[]>([]);
const [loading, setLoading] = useState(true);
const [selectedPlan, setSelectedPlan] = useState('standard');
const [couponCode, setCouponCode] = useState('');
const [applying, setApplying] = useState(false);
const [msg, setMsg] = useState({ type: '', text: '' });
const [appliedDiscount, setAppliedDiscount] = useState<number | null>(null);
// Payment Modal States
const [showPaymentModal, setShowPaymentModal] = useState(false);
const [paymentMethod, setPaymentMethod] = useState<'bank' | 'crypto'>('bank');
const [selectedCurrency, setSelectedCurrency] = useState('NGN');
const [selectedCrypto, setSelectedCrypto] = useState('USDT');
const [modalStep, setModalStep] = useState<'details' | 'verify'>('details');
const [senderRef, setSenderRef] = useState('');
const [copiedKey, setCopiedKey] = useState<string | null>(null);
const [copiedNotification, setCopiedNotification] = useState<string | null>(null);
const [receiptFileName, setReceiptFileName] = useState<string>('');
const [receiptPreview, setReceiptPreview] = useState<string | null>(null);
const fetchStatus = async () => {
try {
const [statusRes, plansRes] = await Promise.all([
apiFetch('/api/monetization/status'),
apiFetch('/api/monetization/plans')
]);
if (statusRes.ok) {
const data = await statusRes.json();
setStatus(data);
// Auto-detect currency based on user country
const userCountry = (data.country || '').toLowerCase();
if (userCountry.includes('nigeria') || userCountry.includes('ng')) {
setSelectedCurrency('NGN');
} else if (userCountry.includes('united kingdom') || userCountry.includes('uk') || userCountry.includes('britain')) {
setSelectedCurrency('GBP');
} else if (userCountry.includes('germany') || userCountry.includes('france') || userCountry.includes('spain') || userCountry.includes('italy') || userCountry.includes('europe')) {
setSelectedCurrency('EUR');
} else {
setSelectedCurrency('USD');
}
}
if (plansRes.ok) {
const pData = await plansRes.json();
const filtered = pData.filter((p: any) => ['basic', 'standard', 'premium'].includes(p.key));
setPlans(filtered);
}
} catch (e) {
console.error("Failed to fetch monetization data", e);
} finally {
setLoading(false);
}
};
useEffect(() => {
fetchStatus();
}, []);
const copyToClipboard = (text: string, key: string, label: string = "Copied to clipboard") => {
navigator.clipboard.writeText(text);
setCopiedKey(key);
setCopiedNotification(label);
setTimeout(() => {
setCopiedKey(null);
setCopiedNotification(null);
}, 2200);
};
const applyCoupon = async () => {
if (!couponCode.trim()) return;
setApplying(true);
setMsg({ type: '', text: '' });
try {
const res = await apiFetch(`/api/monetization/apply-coupon?code=${encodeURIComponent(couponCode.trim())}`, { method: 'POST' });
const data = await res.json();
if (res.ok) {
if (data.discount === 'free') {
setMsg({ type: 'success', text: '🎉 Free VIP Access Activated! Unlocking workspace...' });
setTimeout(() => window.location.reload(), 1800);
} else {
setAppliedDiscount(data.new_price);
setMsg({ type: 'success', text: data.message });
}
} else {
setMsg({ type: 'error', text: data.detail || 'Invalid or expired coupon code.' });
}
} catch {
setMsg({ type: 'error', text: 'Server error. Please try again.' });
} finally {
setApplying(false);
}
};
// Calculate dynamic converted price
const getConvertedPrice = (cur: string) => {
const plan = plans.find(p => p.key === selectedPlan);
const baseNgn = appliedDiscount ?? (plan?.price || 3500);
if (cur === 'NGN') return `₦${baseNgn.toLocaleString()}`;
if (cur === 'USD') return `$${(baseNgn * EXCHANGE_RATES.USD).toFixed(2)}`;
if (cur === 'EUR') return `€${(baseNgn * EXCHANGE_RATES.EUR).toFixed(2)}`;
if (cur === 'GBP') return `£${(baseNgn * EXCHANGE_RATES.GBP).toFixed(2)}`;
if (cur === 'USDT') return `${(baseNgn * EXCHANGE_RATES.USDT).toFixed(2)} USDT`;
if (cur === 'BTC') return `${(baseNgn * EXCHANGE_RATES.BTC).toFixed(6)} BTC`;
if (cur === 'SOL') return `${(baseNgn * EXCHANGE_RATES.SOL).toFixed(4)} SOL`;
return `${baseNgn}`;
};
const handleConfirmPaymentMade = () => {
setModalStep('verify');
};
const handleWhatsAppSubmit = async () => {
setApplying(true);
try {
const plan = plans.find(p => p.key === selectedPlan);
const planName = plan ? plan.name : selectedPlan;
const cur = paymentMethod === 'bank' ? selectedCurrency : selectedCrypto;
const convertedAmountStr = getConvertedPrice(cur);
// 1. Submit payment request to backend
await apiFetch('/api/monetization/submit-payment', {
method: 'POST',
body: JSON.stringify({
plan_key: selectedPlan,
method: paymentMethod,
currency: cur,
amount: appliedDiscount ?? (plan?.price || 0),
proof_details: senderRef.trim() ? `Sender/Ref: ${senderRef.trim()}` : `Manual ${paymentMethod.toUpperCase()} (${cur})`
})
});
// 2. Short, crisp, properly formatted message with accurate price
const summaryText =
`Hello ArkiTel Desk,\n\n` +
`I have made payment for the *${planName}* plan (${convertedAmountStr}).\n` +
`Username: *${status?.username || 'My Account'}*\n` +
(senderRef.trim() ? `Reference / Sender: *${senderRef.trim()}*\n` : '') +
`\nPayment receipt is attached below. Kindly verify and activate!`;
try {
await navigator.clipboard.writeText(summaryText);
} catch (err) { }
// 3. Open WhatsApp directly to desk phone with clean dynamic text
const directWhatsAppUrl = `https://wa.me/${WHATSAPP_PHONE}?text=${encodeURIComponent(summaryText)}`;
window.open(directWhatsAppUrl, '_blank');
// 4. Update UI status to Verification Pending
setStatus((prev: any) => ({ ...prev, has_proof: true }));
setShowPaymentModal(false);
setModalStep('details');
} catch (e) {
console.error("Payment submission failed", e);
} finally {
setApplying(false);
}
};
if (loading) return <>{children}</>;
const isLocked = !status || status?.plan === 'free' || !status?.plan;
return (
<div className="relative w-full min-h-[500px]">
{/* Page Content underneath: softly blurred & non-interactive when locked */}
<div className={isLocked ? "pointer-events-none select-none filter blur-[3px] opacity-25 transition-all duration-300 max-h-[85vh] overflow-hidden" : ""}>
{children}
</div>
{isLocked && (
<>
{/* IN-PAGE LOCK SHOWCASE: Confined strictly within the content container, keeping the sidebar & navbar accessible */}
<div className="absolute inset-0 z-20 flex items-start justify-center pt-3 sm:pt-6 pb-12 px-2 sm:px-4 overflow-y-auto">
{/* Subtle dark backdrop over the locked content */}
<div className="absolute inset-0 bg-black/75 backdrop-blur-sm rounded-2xl pointer-events-none" />
{/* Modern Showcase Card */}
<div className="relative w-full max-w-4xl bg-card border border-border/80 rounded-2xl p-5 sm:p-7 lg:p-8 shadow-2xl flex flex-col z-10 animate-in fade-in zoom-in-95 duration-200 overflow-hidden">
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-1/2 h-[2px] bg-gradient-to-r from-transparent via-indigo-500 to-transparent"></div>
{/* Header: Clean, Human & High-Contrast */}
<div className="text-center mb-6 shrink-0">
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-indigo-500/15 border border-indigo-500/30 text-indigo-300 text-xs font-semibold mb-3 shadow-sm">
<Lock size={13} className="text-indigo-400" />
<span>Locked Feature • {featureName}</span>
</div>
<h2 className="text-2xl sm:text-3xl font-extrabold text-foreground tracking-tight">
Supercharge Your Automation Fleet
</h2>
<p className="text-xs sm:text-sm text-foreground/60 max-w-xl mx-auto mt-1.5 leading-relaxed">
Choose an active tier to unlock <span className="text-foreground font-semibold">{featureName}</span>, run simultaneous campaign dispatches, and lift scraping limits.
</p>
</div>
{/* Main Content Area */}
<div className="space-y-5">
{status?.has_proof ? (
/* Verification Pending State */
<div className="bg-input/50 border border-emerald-500/30 p-8 rounded-2xl text-center space-y-4">
<div className="w-14 h-14 mx-auto rounded-xl bg-emerald-500/10 border border-emerald-500/25 flex items-center justify-center text-emerald-400">
<CheckCircle2 size={32} />
</div>
<div>
<div className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-500/15 text-emerald-400 text-xs font-semibold mb-2 border border-emerald-500/30">
Receipt Under Review
</div>
<h3 className="font-bold text-lg text-white">Verification in Progress</h3>
<p className="text-xs sm:text-sm text-slate-400 leading-relaxed max-w-md mx-auto mt-1">
Your payment is registered with our administration desk. Your account will be upgraded within a few minutes.
</p>
</div>
<div className="flex flex-col sm:flex-row items-center justify-center gap-3 pt-2">
<a
href={`https://wa.me/${WHATSAPP_PHONE}?text=${encodeURIComponent(`Hello ArkiTel Desk, checking on payment verification for ${status?.username || 'my account'}.`)}`}
target="_blank"
rel="noopener noreferrer"
className="w-full sm:w-auto px-6 py-2.5 rounded-xl bg-[#25D366] hover:bg-[#20ba59] text-black font-semibold text-xs sm:text-sm transition-all flex items-center justify-center gap-2 cursor-pointer shadow-md active:scale-95"
>
<MessageCircle size={16} />
<span>Open Official WhatsApp Desk</span>
<ExternalLink size={13} />
</a>
<button
onClick={() => {
setStatus((prev: any) => ({ ...prev, has_proof: false }));
setShowPaymentModal(true);
}}
className="w-full sm:w-auto px-5 py-2.5 rounded-xl bg-white/5 hover:bg-white/10 text-slate-300 font-medium text-xs sm:text-sm transition-colors border border-white/10 cursor-pointer"
>
Submit Another Transaction
</button>
</div>
</div>
) : (
<>
{/* 3-Tier Plan Grid - Equal height, strict no-overlapping borders */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-3.5 sm:gap-4 items-stretch">
{plans.map((plan) => {
const meta = PLAN_METADATA[plan.key] || {
icon: Star,
tag: 'Plan',
headline: 'Standard Access Plan',
popular: false
};
const Icon = meta.icon;
const isSelected = selectedPlan === plan.key;
const perks = typeof plan.perks === 'string' ? JSON.parse(plan.perks) : (plan.perks || []);
return (
<button
key={plan.key}
type="button"
onClick={() => setSelectedPlan(plan.key)}
className={`w-full h-full flex flex-col justify-between text-left p-5 rounded-xl border transition-all cursor-pointer group ${
isSelected
? 'bg-input border-indigo-500/80 ring-1 ring-indigo-500/50 shadow-xl'
: 'bg-card/90 border-border/70 hover:border-indigo-500/30 hover:bg-input/40'
}`}
>
<div>
{/* Top Row: Icon + Tag */}
<div className="flex items-center justify-between mb-3 w-full">
<div className={`w-9 h-9 rounded-lg flex items-center justify-center transition-colors ${
isSelected ? 'bg-indigo-600 text-white shadow-md' : 'bg-white/5 text-slate-400 border border-white/10'
}`}>
<Icon size={18} />
</div>
{meta.popular ? (
<span className="text-[10px] font-bold uppercase tracking-wider px-2.5 py-0.5 rounded-full bg-indigo-500/20 text-indigo-300 border border-indigo-500/40 shadow-sm flex items-center gap-1">
<Sparkles size={10} className="text-indigo-400" />
{meta.tag}
</span>
) : (
<span className="text-[11px] font-medium text-slate-400 px-2 py-0.5 rounded bg-white/[0.04]">
{meta.tag}
</span>
)}
</div>
{/* Name & Headline */}
<div className="font-bold text-base text-white group-hover:text-indigo-300 transition-colors">
{plan.name}
</div>
<div className="text-xs text-slate-400 mt-1 line-clamp-1">
{meta.headline}
</div>
{/* Pricing Block */}
<div className="my-3 py-2.5 border-y border-white/[0.08] flex flex-col gap-0.5">
<div className="flex items-baseline gap-1.5">
<span className="text-2xl font-extrabold text-white tracking-tight">
₦{plan.price.toLocaleString()}
</span>
<span className="text-xs text-slate-400 font-medium">/month</span>
</div>
<div className="text-xs font-medium text-slate-400 flex items-center gap-1.5 mt-0.5">
<span>≈ ${(plan.price / 1500).toFixed(2)} USD</span>
<span className="text-slate-600">•</span>
<span className="text-emerald-400 font-mono text-[11px]">Fair FX</span>
</div>
</div>
{/* Perks Checklist */}
<div className="space-y-2 mt-2">
{perks.slice(0, 4).map((perk: string) => (
<div key={perk} className="flex items-start gap-2 text-xs text-slate-300 leading-snug">
<Check size={14} className="text-emerald-400 shrink-0 mt-0.5" />
<span className="line-clamp-2">{perk}</span>
</div>
))}
{perks.length > 4 && (
<div className="text-[11px] font-medium text-indigo-400 pl-5">
+ {perks.length - 4} more features included
</div>
)}
</div>
</div>
{/* Selection Status */}
<div className={`mt-4 pt-3 border-t border-white/[0.08] w-full flex items-center justify-between text-xs font-medium ${
isSelected ? 'text-indigo-400' : 'text-slate-400'
}`}>
<span>{isSelected ? 'Selected Plan' : 'Select Plan'}</span>
<div className={`w-4 h-4 rounded-full flex items-center justify-center border transition-all ${
isSelected ? 'bg-indigo-600 border-indigo-500 text-white' : 'border-white/20'
}`}>
{isSelected && <Check size={10} />}
</div>
</div>
</button>
);
})}
</div>
{/* Action Bar: Pay Button & Coupon */}
<div className="pt-2 space-y-3">
<div className="grid grid-cols-1 md:grid-cols-12 gap-3 items-center">
{/* Primary Pay & Upgrade CTA */}
<button
onClick={() => {
setModalStep('details');
setShowPaymentModal(true);
}}
type="button"
className="md:col-span-8 w-full bg-indigo-600 hover:bg-indigo-500 text-white font-semibold py-3.5 px-6 rounded-xl transition-all flex items-center justify-center gap-2.5 text-sm shadow-md active:scale-[0.99] cursor-pointer"
>
<CreditCard size={18} />
<span>Pay & Upgrade to {plans.find(p => p.key === selectedPlan)?.name || 'Tier'}</span>
<ArrowRight size={16} />
</button>
{/* Coupon Input */}
<div className="md:col-span-4 flex items-center bg-input/60 border border-border/70 p-1.5 rounded-xl">
<input
type="text"
placeholder="COUPON / VIP CODE"
value={couponCode}
onChange={(e) => setCouponCode(e.target.value.toUpperCase())}
className="flex-1 bg-transparent px-3 py-1.5 text-xs font-medium outline-none text-white placeholder:text-slate-500 tracking-wider uppercase text-center"
/>
<button
onClick={applyCoupon}
disabled={applying || !couponCode.trim()}
className="px-3.5 py-1.5 rounded-lg bg-white/10 hover:bg-white/15 text-white font-medium text-xs uppercase transition-colors cursor-pointer disabled:opacity-40"
>
{applying ? '...' : 'Apply'}
</button>
</div>
</div>
{msg.text && (
<div className={`flex items-center justify-center gap-2 py-2.5 px-4 rounded-xl text-xs font-medium border transition-all animate-in slide-in-from-top-1 ${
msg.type === 'error' ? 'bg-red-500/10 text-red-400 border-red-500/20' : 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20'
}`}>
<AlertCircle size={14} />
<span>{msg.text}</span>
</div>
)}
{/* Security & Guarantee Trust Bar */}
<div className="flex flex-wrap items-center justify-center gap-5 sm:gap-8 pt-1 text-xs text-slate-400 font-medium">
<span className="flex items-center gap-1.5">
<ShieldCheck size={14} className="text-emerald-400" />
256-Bit Encrypted Transfer
</span>
<span className="flex items-center gap-1.5">
<Clock size={14} className="text-indigo-400" />
Fast Desk Verification
</span>
<span className="flex items-center gap-1.5">
<Globe size={14} className="text-cyan-400" />
Bank & Crypto Accepted
</span>
</div>
</div>
</>
)}
</div>
</div>
</div>
{/* MODAL: Payment Channels, Bank Accounts & Crypto — Fixed Viewport Centered */}
{showPaymentModal && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 md:p-6 overflow-hidden">
{/* Frosted deep dark backdrop over entire screen */}
<div
className="fixed inset-0 bg-black/80 backdrop-blur-sm transition-opacity"
onClick={() => setShowPaymentModal(false)}
/>
{/* Centered Modal Container (Side-by-Side 2-Column Desktop Layout) */}
<div className="relative w-full max-w-4xl lg:max-w-5xl bg-card border border-border/80 rounded-2xl p-4 sm:p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200 overflow-hidden flex flex-col max-h-[85vh] z-10">
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-1/2 h-[2px] bg-gradient-to-r from-transparent via-indigo-500 to-transparent"></div>
{/* Floating Copied Toast Alert */}
{copiedNotification && (
<div className="absolute top-4 left-1/2 -translate-x-1/2 z-50 px-4 py-2 rounded-full bg-emerald-500 text-black text-xs font-bold shadow-xl flex items-center gap-1.5 animate-in slide-in-from-top-2 duration-150">
<Check size={14} />
<span>{copiedNotification}</span>
</div>
)}
{/* Modal Header */}
<div className="flex items-center justify-between pb-4 border-b border-white/[0.08] shrink-0">
<div className="flex items-center gap-2.5 sm:gap-3 min-w-0">
{/* Back Button */}
<button
type="button"
onClick={() => {
if (modalStep === 'verify') {
setModalStep('details');
} else {
setShowPaymentModal(false);
}
}}
className="p-2 sm:px-2.5 sm:py-2 rounded-xl bg-white/5 hover:bg-white/10 text-slate-300 hover:text-white transition-colors cursor-pointer border border-white/10 flex items-center gap-1.5 text-xs font-semibold shrink-0"
title={modalStep === 'verify' ? "Back to Payment Details" : "Back to Plan Selection"}
>
<ArrowLeft size={15} />
<span className="hidden sm:inline">{modalStep === 'verify' ? 'Back' : 'Back to Plans'}</span>
</button>
<div className="w-10 h-10 rounded-xl bg-indigo-600/20 border border-indigo-500/30 flex items-center justify-center text-indigo-400 shadow-md shrink-0">
{modalStep === 'verify' ? <ShieldCheck size={20} className="text-emerald-400" /> : (paymentMethod === 'bank' ? <Building2 size={20} /> : <Coins size={20} />)}
</div>
<div className="min-w-0">
<h3 className="font-bold text-base sm:text-lg text-white flex items-center gap-2 truncate">
<span>{modalStep === 'details' ? 'Payment Checkout' : 'Receipt Verification Desk'}</span>
<span className="text-[10px] font-bold px-2 py-0.5 rounded-full bg-indigo-500/15 text-indigo-300 border border-indigo-500/30 shrink-0">
{modalStep === 'details' ? 'Step 1 of 2' : 'Step 2 of 2'}
</span>
</h3>
<p className="text-xs text-slate-400 mt-0.5 truncate">
Plan: <strong className="text-white font-medium">{plans.find(p => p.key === selectedPlan)?.name}</strong> • Total Due: <strong className="text-emerald-400 font-semibold">{getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}</strong>
</p>
</div>
</div>
{/* Close Button */}
<button
type="button"
onClick={() => setShowPaymentModal(false)}
className="p-2 rounded-xl text-slate-400 hover:text-white hover:bg-white/10 transition-colors cursor-pointer border border-transparent hover:border-white/10 shrink-0 ml-2"
title="Close modal"
>
<X size={20} />
</button>
</div>
{/* Modal Body Container */}
<div className="flex-1 min-h-0 py-4 overflow-hidden flex flex-col">
{modalStep === 'details' ? (
/* Side-by-Side: Left Column Fixed, Right Column Scrollable */
<div className="grid grid-cols-1 lg:grid-cols-12 gap-5 lg:gap-6 items-start flex-1 min-h-0 overflow-y-auto lg:overflow-hidden">
{/* Left Column (5 of 12): Channel Switcher, Currency / Token Chips & Order Summary (Fixed on Desktop) */}
<div className="lg:col-span-5 space-y-4 shrink-0 lg:overflow-y-auto lg:max-h-[calc(85vh-130px)] custom-scrollbar pr-1">
{/* 1. Channel Switcher */}
<div>
<label className="text-[11px] uppercase font-bold text-slate-400 tracking-wider block mb-2 px-0.5">
1. Select Payment Channel
</label>
<div className="grid grid-cols-2 gap-2.5">
<button
type="button"
onClick={() => setPaymentMethod('bank')}
className={`flex flex-col p-3.5 rounded-xl border transition-all text-left cursor-pointer ${
paymentMethod === 'bank'
? 'bg-indigo-600/20 border-indigo-500 text-foreground shadow-md ring-1 ring-indigo-500/50'
: 'bg-input/40 border-border/70 text-foreground/70 hover:bg-input/70 hover:border-border'
}`}
>
<div className={`w-8 h-8 rounded-lg flex items-center justify-center mb-2 ${paymentMethod === 'bank' ? 'bg-indigo-600 text-white' : 'bg-input/50 text-foreground/50'}`}>
<Building2 size={16} />
</div>
<span className="font-bold text-xs text-foreground">Bank Transfer</span>
<span className="text-[10px] text-foreground/50 mt-0.5">NGN, USD, GBP, EUR</span>
</button>
<button
type="button"
onClick={() => setPaymentMethod('crypto')}
className={`flex flex-col p-3.5 rounded-xl border transition-all text-left cursor-pointer ${
paymentMethod === 'crypto'
? 'bg-indigo-600/20 border-indigo-500 text-foreground shadow-md ring-1 ring-indigo-500/50'
: 'bg-input/40 border-border/70 text-foreground/70 hover:bg-input/70 hover:border-border'
}`}
>
<div className={`w-8 h-8 rounded-lg flex items-center justify-center mb-2 ${paymentMethod === 'crypto' ? 'bg-indigo-600 text-white' : 'bg-input/50 text-foreground/50'}`}>
<Coins size={16} />
</div>
<span className="font-bold text-xs text-foreground">Crypto Deposit</span>
<span className="text-[10px] text-foreground/50 mt-0.5">USDT, BTC, Solana</span>
</button>
</div>
</div>
{/* 2. Currency / Coin Selector Chips */}
{paymentMethod === 'bank' ? (
<div>
<div className="flex items-center justify-between mb-2 px-0.5">
<span className="text-[11px] uppercase font-bold text-slate-400 tracking-wider">
2. Choose Currency
</span>
<span className="text-[11px] font-medium text-indigo-400">Direct FX Conversion</span>
</div>
<div className="grid grid-cols-2 gap-2">
{Object.entries(BANK_ACCOUNTS).map(([currKey, acc]) => {
const isSel = selectedCurrency === currKey;
return (
<button
key={currKey}
type="button"
onClick={() => setSelectedCurrency(currKey)}
className={`flex items-center gap-2.5 p-2.5 rounded-xl border text-left transition-all cursor-pointer ${
isSel
? 'bg-input border-indigo-500/80 ring-1 ring-indigo-500/40 text-foreground shadow-sm'
: 'bg-input/30 border-border/60 text-foreground/70 hover:border-border hover:bg-input/60'
}`}
>
<CurrencyFlag currency={currKey} />
<div className="min-w-0">
<div className="text-xs font-bold text-foreground">{currKey}</div>
<div className="text-[10px] font-semibold text-emerald-400 truncate">{getConvertedPrice(currKey)}</div>
</div>
</button>
);
})}
</div>
</div>
) : (
<div>
<div className="flex items-center justify-between mb-2 px-0.5">
<span className="text-[11px] uppercase font-bold text-slate-400 tracking-wider">
2. Choose Cryptocurrency
</span>
<span className="text-[11px] font-medium text-indigo-400">On-Chain Transfer</span>
</div>
<div className="grid grid-cols-3 gap-2">
{Object.entries(CRYPTO_WALLETS).map(([cKey, cw]) => {
const isSel = selectedCrypto === cKey;
return (
<button
key={cKey}
type="button"
onClick={() => setSelectedCrypto(cKey)}
className={`flex flex-col items-center py-2.5 px-2 rounded-xl border text-center transition-all cursor-pointer ${
isSel
? 'bg-input border-indigo-500/80 ring-1 ring-indigo-500/40 text-foreground shadow-sm'
: 'bg-input/30 border-border/60 text-foreground/70 hover:border-border hover:bg-input/60'
}`}
>
<CurrencyFlag currency={cKey} />
<span className="text-xs font-bold text-foreground mt-1">{cw.symbol}</span>
<span className="text-[10px] font-semibold text-emerald-400 truncate max-w-full">{getConvertedPrice(cKey)}</span>
</button>
);
})}
</div>
</div>
)}
{/* Summary Recap Card */}
<div className="bg-input/40 border border-border/70 rounded-xl p-3.5 space-y-2">
<div className="flex items-center justify-between text-xs">
<span className="text-foreground/50">Selected Tier</span>
<span className="text-foreground font-semibold">{plans.find(p => p.key === selectedPlan)?.name}</span>
</div>
<div className="flex items-center justify-between text-xs">
<span className="text-foreground/50">Billing Term</span>
<span className="text-foreground font-medium">Monthly Access (30 Days)</span>
</div>
<div className="pt-2 border-t border-border/60 flex items-center justify-between">
<span className="text-xs font-bold text-foreground">Total Due</span>
<span className="text-sm font-extrabold text-emerald-400">
{getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}
</span>
</div>
</div>
</div>
{/* Right Column (7 of 12): Dedicated Scrollable Section on Desktop */}
<div className="lg:col-span-7 space-y-4 lg:overflow-y-auto lg:max-h-[calc(85vh-130px)] custom-scrollbar pr-2 pb-2">
{/* Prominent Amount Card with 1-Click Copy */}
<div className="bg-input/50 border border-emerald-500/30 rounded-xl p-4 flex items-center justify-between gap-3 shadow-xs">
<div>
<div className="text-[10px] uppercase font-bold tracking-wider text-emerald-400 flex items-center gap-1">
<Sparkles size={11} />
<span>Exact Amount To Send</span>
</div>
<div className="text-2xl font-extrabold text-white mt-0.5 tracking-tight flex items-center gap-2">
<CurrencyFlag currency={paymentMethod === 'bank' ? selectedCurrency : selectedCrypto} />
<span>{getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}</span>
</div>
<div className="text-[11px] text-slate-400 mt-0.5">
{paymentMethod === 'bank' ? BANK_ACCOUNTS[selectedCurrency]?.sublabel : `Network: ${CRYPTO_WALLETS[selectedCrypto]?.network}`}
</div>
</div>
<button
type="button"
onClick={() => copyToClipboard(getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto).replace(/[^0-9.]/g, ''), 'amount-copy', 'Numeric amount copied')}
className="px-3.5 py-2 rounded-lg bg-emerald-500 hover:bg-emerald-400 text-black font-bold text-xs transition-colors flex items-center gap-1.5 cursor-pointer shrink-0 shadow-sm"
>
<Copy size={13} />
<span>Copy Amount</span>
</button>
</div>
{/* Bank Accounts Grid with Individual Copy Buttons */}
{paymentMethod === 'bank' && (
<div className="space-y-2.5">
<div className="text-[11px] uppercase font-bold text-slate-400 tracking-wider px-0.5">
Destination Account ({BANK_ACCOUNTS[selectedCurrency]?.label})
</div>
<div className="grid grid-cols-1 gap-2">
{BANK_ACCOUNTS[selectedCurrency]?.details.map((field, idx) => (
<div
key={idx}
className={`p-3 rounded-xl border flex items-center justify-between gap-3 ${
field.isPrimary
? 'bg-input/70 border-indigo-500/60 ring-1 ring-indigo-500/30'
: 'bg-input/40 border-border/60'
}`}
>
<div className="min-w-0 flex-1">
<div className="text-[10px] uppercase font-bold text-slate-400 flex items-center gap-1.5">
<span>{field.label}</span>
{field.isPrimary && (
<span className="text-[9px] text-indigo-300 font-bold uppercase px-1.5 py-0.5 rounded bg-indigo-500/15">
Primary
</span>
)}
</div>
<div className={`font-mono font-bold truncate select-all mt-0.5 ${field.isPrimary ? 'text-white text-base' : 'text-slate-200 text-xs sm:text-sm'}`}>
{field.value}
</div>
</div>
<button
type="button"
onClick={() => copyToClipboard(field.value, `bank-field-${idx}`, `${field.label} copied`)}
className={`px-3 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-colors shrink-0 cursor-pointer ${
copiedKey === `bank-field-${idx}`
? 'bg-emerald-500 text-black'
: 'bg-white/5 hover:bg-white/10 text-slate-300 border border-white/10'
}`}
>
{copiedKey === `bank-field-${idx}` ? (
<>
<Check size={13} />
<span>Copied</span>
</>
) : (
<>
<Copy size={13} />
<span>Copy</span>
</>
)}
</button>
</div>
))}
</div>
</div>
)}
{/* Crypto Wallet Details */}
{paymentMethod === 'crypto' && (() => {
const cw = CRYPTO_WALLETS[selectedCrypto];
return (
<div className="space-y-3">
{/* Network Warning Banner */}
<div className="p-3.5 rounded-xl bg-amber-500/10 border border-amber-500/25 text-amber-300 text-xs leading-relaxed flex items-start gap-2.5">
<span className="text-base shrink-0">⚠️</span>
<div>
<strong className="text-white block font-semibold">Network Verification:</strong>
<span>Send only <strong className="text-amber-200">{cw.name}</strong> on the <strong className="text-amber-200">{cw.network}</strong> network. Other networks will result in lost funds.</span>
</div>
</div>
{/* Deposit Address Box */}
<div className="p-4 rounded-xl bg-input/40 border border-border/70 space-y-2">
<div className="flex items-center justify-between text-xs">
<span className="text-slate-400 font-medium">
Deposit Address ({cw.network})
</span>
<span className="text-[11px] font-semibold px-2 py-0.5 rounded bg-white/5 text-slate-300">
{cw.network}
</span>
</div>
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-2.5 bg-black/40 p-3 rounded-lg border border-white/[0.08]">
<div className="font-mono text-xs sm:text-sm font-semibold text-emerald-400 break-all select-all flex-1">
{cw.address}
</div>
<button
type="button"
onClick={() => copyToClipboard(cw.address, 'crypto-wallet-addr', 'Wallet address copied')}
className={`px-3.5 py-1.5 rounded-lg text-xs font-semibold flex items-center justify-center gap-1.5 transition-colors shrink-0 cursor-pointer ${
copiedKey === 'crypto-wallet-addr'
? 'bg-emerald-500 text-black'
: 'bg-indigo-600 hover:bg-indigo-500 text-white'
}`}
>
{copiedKey === 'crypto-wallet-addr' ? (
<>
<Check size={13} />
<span>Copied</span>
</>
) : (
<>
<Copy size={13} />
<span>Copy Address</span>
</>
)}
</button>
</div>
</div>
</div>
);
})()}
{/* Primary "I've Made Payment" CTA */}
<button
type="button"
onClick={handleConfirmPaymentMade}
className="w-full bg-indigo-600 hover:bg-indigo-500 text-white font-semibold py-3.5 rounded-xl transition-all flex items-center justify-center gap-2 text-sm shadow-md active:scale-[0.99] cursor-pointer mt-2"
>
<span>I've Sent Payment — Continue to Verification</span>
<ArrowRight size={16} />
</button>
</div>
</div>
) : (
/* Step 2: Luxury Redesigned Receipt Verification Desk */
<div className="overflow-y-auto custom-scrollbar flex-1 max-h-[calc(85vh-130px)] pr-2 py-1 space-y-4 max-w-2xl mx-auto w-full animate-in fade-in zoom-in-95 duration-200">
{/* Stepper Progress Bar */}
<div className="flex items-center justify-between max-w-md mx-auto px-4 py-2 rounded-xl bg-white/[0.04] border border-white/10 text-xs">
<div className="flex items-center gap-1.5 text-emerald-400 font-bold">
<div className="w-5 h-5 rounded-full bg-emerald-500/20 border border-emerald-500/40 flex items-center justify-center text-[10px]">✓</div>
<span>Payment Sent</span>
</div>
<div className="h-0.5 w-10 bg-emerald-500/40" />
<div className="flex items-center gap-1.5 text-indigo-400 font-bold">
<div className="w-5 h-5 rounded-full bg-indigo-500/20 border border-indigo-500/60 flex items-center justify-center text-[10px] animate-pulse">2</div>
<span>Verification Desk</span>
</div>
<div className="h-0.5 w-10 bg-white/10" />
<div className="flex items-center gap-1.5 text-slate-400 font-medium">
<div className="w-5 h-5 rounded-full bg-white/5 border border-white/10 flex items-center justify-center text-[10px]">3</div>
<span>Account Active</span>
</div>
</div>
{/* Luxury Digital Voucher / Clearing Pass */}
<div className="relative bg-card border border-border/80 ring-1 ring-indigo-500/20 rounded-2xl shadow-2xl overflow-hidden">
{/* Top Holographic Watermark Bar */}
<div className="bg-gradient-to-r from-indigo-950/80 via-[#151c34] to-indigo-950/80 px-4 py-3 border-b border-white/10 flex flex-wrap items-center justify-between gap-2">
<div className="flex items-center gap-2">
<span className="w-2.5 h-2.5 rounded-full bg-indigo-400 shadow-sm shadow-indigo-400/50" />
<span className="text-[11px] font-black uppercase tracking-wider text-indigo-200">
ArkiTel Financial Clearing Voucher
</span>
</div>
<div className="flex items-center gap-2">
<span className="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-emerald-500/15 border border-emerald-500/30 text-[10px] font-extrabold text-emerald-400">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400 animate-ping" />
<span>Concierge Active (< 5 min SLA)</span>
</span>
</div>
</div>
{/* Voucher Grid: 4 Core Parameters */}
<div className="p-4 sm:p-5 grid grid-cols-2 sm:grid-cols-4 gap-3 bg-black/20">
<div className="p-3 rounded-xl bg-white/[0.03] border border-white/5 space-y-1">
<span className="text-[10px] font-bold uppercase tracking-wider text-slate-400 block">Selected Tier</span>
<div className="flex items-center gap-1.5">
<Sparkles size={13} className="text-indigo-400 shrink-0" />
<span className="font-extrabold text-white text-xs sm:text-sm truncate">
{plans.find(p => p.key === selectedPlan)?.name}
</span>
</div>
</div>
<div className="p-3 rounded-xl bg-white/[0.03] border border-white/5 space-y-1">
<span className="text-[10px] font-bold uppercase tracking-wider text-slate-400 block">Amount Sent</span>
<div className="flex items-center gap-1.5">
<CurrencyFlag currency={paymentMethod === 'bank' ? selectedCurrency : selectedCrypto} />
<span className="font-extrabold text-emerald-400 text-xs sm:text-sm truncate">
{getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}
</span>
</div>
</div>
<div className="p-3 rounded-xl bg-white/[0.03] border border-white/5 space-y-1">
<span className="text-[10px] font-bold uppercase tracking-wider text-slate-400 block">Channel</span>
<span className="font-bold text-slate-200 text-xs sm:text-sm truncate block">
{paymentMethod === 'bank' ? `Bank (${selectedCurrency})` : `Crypto (${selectedCrypto})`}
</span>
</div>
<div className="p-3 rounded-xl bg-white/[0.03] border border-white/5 space-y-1">
<span className="text-[10px] font-bold uppercase tracking-wider text-slate-400 block">Account ID</span>
<span className="font-mono font-bold text-indigo-300 text-xs sm:text-sm truncate block">
@{status?.username || 'Current Operator'}
</span>
</div>
</div>
{/* Perforated Voucher Tear Line */}
<div className="relative flex items-center justify-between px-2 py-1">
<div className="w-4 h-4 rounded-full bg-card -ml-4 border-r border-border/60" />
<div className="flex-1 border-t-2 border-dashed border-border/60 mx-2" />
<div className="w-4 h-4 rounded-full bg-card -mr-4 border-l border-border/60" />
</div>
{/* Interactive Proof Submission Controls */}
<div className="p-4 sm:p-5 space-y-4">
{/* Payer Name / Reference Input */}
<div className="space-y-1.5">
<div className="flex items-center justify-between text-xs">
<label htmlFor="payer-ref-input" className="font-bold text-white flex items-center gap-1.5">
<span>Transfer Reference / Payer Account Name</span>
<span className="text-slate-400 text-[10px] font-normal">(Optional)</span>
</label>
<span className="text-[10px] font-semibold text-emerald-400">Speeds Up Immediate Unlock</span>
</div>
<div className="relative">
<input
id="payer-ref-input"
type="text"
placeholder="e.g., Victor Adeleye - Access Bank Ref #91823"
value={senderRef}
onChange={(e) => setSenderRef(e.target.value)}
className="w-full bg-black/50 border border-white/15 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/40 rounded-xl px-4 py-3 text-xs sm:text-sm text-white placeholder:text-slate-500 outline-none transition-all font-medium"
/>
</div>
</div>
{/* Simulated / Interactive Receipt Dropzone */}
<div className="space-y-1.5">
<label className="text-xs font-bold text-white flex items-center justify-between">
<span>Attach Payment Proof / Screenshot</span>
<span className="text-[10px] text-slate-400">PNG, JPG, PDF up to 10MB</span>
</label>
<input
type="file"
id="receipt-file-picker"
accept="image/*,.pdf"
className="hidden"
onChange={(e) => {
if (e.target.files && e.target.files[0]) {
const f = e.target.files[0];
setReceiptFileName(f.name);
setReceiptPreview(URL.createObjectURL(f));
}
}}
/>
{receiptFileName ? (
<div className="p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-between gap-3 animate-in fade-in duration-150">
<div className="flex items-center gap-2.5 min-w-0">
<CheckCircle2 size={18} className="text-emerald-400 shrink-0" />
<div className="min-w-0">
<div className="text-xs font-bold text-white truncate">{receiptFileName}</div>
<div className="text-[10px] text-emerald-400 font-medium">Receipt ready for transmission to WhatsApp Desk</div>
</div>
</div>
<button
type="button"
onClick={() => {
setReceiptFileName('');
setReceiptPreview(null);
}}
className="px-2.5 py-1 rounded-lg bg-white/5 hover:bg-white/10 text-[11px] text-slate-300 transition-colors cursor-pointer shrink-0"
>
Remove
</button>
</div>
) : (
<label
htmlFor="receipt-file-picker"
className="p-4 rounded-xl border border-dashed border-white/20 hover:border-indigo-400/60 bg-white/[0.02] hover:bg-indigo-500/[0.04] transition-all flex items-center justify-center gap-3 cursor-pointer group"
>
<div className="p-2 rounded-lg bg-indigo-500/10 text-indigo-400 group-hover:bg-indigo-500/20 transition-colors">
<Upload size={16} />
</div>
<div className="text-left">
<div className="text-xs font-bold text-slate-200 group-hover:text-white transition-colors">
Click to attach receipt or drag screenshot here
</div>
<div className="text-[10px] text-slate-400">
Transmits directly to our 24/7 verification team
</div>
</div>
</label>
)}
</div>
</div>
</div>
{/* Primary VIP WhatsApp Activation Action */}
<div className="space-y-3 pt-1">
<button
type="button"
onClick={handleWhatsAppSubmit}
disabled={applying}
className="w-full bg-gradient-to-r from-[#25D366] to-[#1ebe5b] hover:from-[#20ba59] hover:to-[#17a54e] text-black font-black py-4 rounded-xl transition-all flex items-center justify-center gap-2.5 text-sm shadow-xl shadow-[#25D366]/20 active:scale-[0.99] cursor-pointer disabled:opacity-50"
>
<MessageCircle size={20} className="fill-black" />
<span>{applying ? 'Opening VIP Desk...' : 'Transmit Proof to WhatsApp Concierge (Fast-Track)'}</span>
<ExternalLink size={16} />
</button>
{/* Alternative Desks Grid & 1-Click Message Copy */}
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs">
<a
href="https://t.me/arkitel_support"
target="_blank"
rel="noopener noreferrer"
className="p-2.5 rounded-xl bg-white/[0.03] hover:bg-white/[0.07] border border-white/10 flex items-center justify-between text-slate-300 hover:text-cyan-400 transition-all cursor-pointer group"
>
<span className="flex items-center gap-2">
<Send size={14} className="text-cyan-400" />
<span className="font-semibold">Telegram VIP Desk</span>
</span>
<span className="text-[11px] text-slate-500 group-hover:text-cyan-300">@arkitel_support</span>
</a>
<a
href={`mailto:${SUPPORT_EMAIL}?subject=ArkiTel%20Payment%20Receipt%20-%20${encodeURIComponent(status?.username || '')}&body=${encodeURIComponent(`Hello ArkiTel Support,\n\nI have attached my receipt for the ${plans.find(p => p.key === selectedPlan)?.name} plan.\nUsername: ${status?.username || ''}\nEmail: ${status?.email || ''}`)}`}
className="p-2.5 rounded-xl bg-white/[0.03] hover:bg-white/[0.07] border border-white/10 flex items-center justify-between text-slate-300 hover:text-amber-400 transition-all cursor-pointer group"
>
<span className="flex items-center gap-2">
<Mail size={14} className="text-amber-400" />
<span className="font-semibold">Email Desk</span>
</span>
<span className="text-[11px] text-slate-500 group-hover:text-amber-300">arkilostudios@gmail.com</span>
</a>
</div>
{/* 1-Click Verification Message Copy */}
<div className="flex items-center justify-between pt-1 px-1">
<span className="text-[11px] text-slate-400">Prefer manual chat message?</span>
<button
type="button"
onClick={() => copyToClipboard(
`Hello ArkiTel Desk,\n\nI have made payment for the *${plans.find(p => p.key === selectedPlan)?.name}* plan (${getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}).\nUsername: *${status?.username || 'My Account'}*\n${senderRef.trim() ? `Reference / Sender: *${senderRef.trim()}*\n` : ''}${receiptFileName ? `Proof File: *${receiptFileName}*\n` : ''}\nPayment receipt is attached. Kindly verify and activate!`,
'copy-preview-msg',
'Verification message text copied!'
)}
className="text-[11px] font-bold text-indigo-400 hover:text-indigo-300 flex items-center gap-1 transition-colors cursor-pointer"
>
<Copy size={12} />
<span>Copy Formatted Voucher Text</span>
</button>
</div>
</div>
</div>
)}
</div>
</div>
</div>
)}
</>
)}
</div>
);
};
'use client';
import React, { useState, useEffect } from 'react';
import { apiFetch } from '@/lib/auth';
import {
Lock, CreditCard, CheckCircle2, X, AlertCircle,
Zap, Star, Crown, Copy, Check, ExternalLink, ShieldCheck,
Building2, Coins, ArrowRight, MessageCircle, Globe,
ArrowLeft, Mail, Clock, Sparkles, Send, Upload, FileText
} from 'lucide-react';
interface MonetizationOverlayProps {
children: React.ReactNode;
featureName: string;
}
const WHATSAPP_PHONE = "2348107791177";
const SUPPORT_EMAIL = "arkilostudios@gmail.com";
const PLAN_METADATA: Record<string, {
icon: any;
tag: string;
headline: string;
popular?: boolean;
}> = {
basic: {
icon: Zap,
tag: 'Starter',
headline: 'Ideal for solo operators & small tests'
},
standard: {
icon: Star,
tag: 'Most Popular',
headline: 'High-volume engine for serious campaigns',
popular: true
},
premium: {
icon: Crown,
tag: 'Enterprise',
headline: 'Maximum scale with unrestricted power'
},
};
// Accurate baseline exchange conversion rates from NGN (base)
const EXCHANGE_RATES: Record<string, number> = {
NGN: 1,
USD: 1 / 1500,
EUR: 1 / 1650,
GBP: 1 / 1950,
USDT: 1 / 1500,
BTC: (1 / 1500) / 65000,
SOL: (1 / 1500) / 150,
};
// Circular Flag / Currency Badge Component (Renders real vibrant flags on all OS including Windows)
const CurrencyFlag: React.FC<{ currency: string }> = ({ currency }) => {
switch (currency) {
case 'NGN':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="12" height="36" fill="#008751" />
<rect x="12" width="12" height="36" fill="#FFFFFF" />
<rect x="24" width="12" height="36" fill="#008751" />
</svg>
</span>
);
case 'USD':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#B22234" />
<path d="M0,5 h36 M0,11 h36 M0,16 h36 M0,21 h36 M0,27 h36 M0,32 h36" stroke="#FFFFFF" strokeWidth="2.5" />
<rect width="16" height="18" fill="#3C3B6E" />
<circle cx="8" cy="9" r="3.5" fill="#FFFFFF" />
</svg>
</span>
);
case 'GBP':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#012169" />
<path d="M0,0 L36,36 M36,0 L0,36" stroke="#FFFFFF" strokeWidth="5" />
<path d="M0,0 L36,36 M36,0 L0,36" stroke="#C8102E" strokeWidth="2.5" />
<path d="M18,0 V36 M0,18 H36" stroke="#FFFFFF" strokeWidth="7" />
<path d="M18,0 V36 M0,18 H36" stroke="#C8102E" strokeWidth="4" />
</svg>
</span>
);
case 'EUR':
return (
<span className="w-6 h-6 rounded-full overflow-hidden shrink-0 inline-flex shadow-sm border border-white/20">
<svg viewBox="0 0 36 36" className="w-full h-full">
<rect width="36" height="36" fill="#003399" />
<circle cx="18" cy="6" r="1.5" fill="#FFCC00" />
<circle cx="18" cy="30" r="1.5" fill="#FFCC00" />
<circle cx="6" cy="18" r="1.5" fill="#FFCC00" />
<circle cx="30" cy="18" r="1.5" fill="#FFCC00" />
<circle cx="10" cy="10" r="1.5" fill="#FFCC00" />
<circle cx="26" cy="10" r="1.5" fill="#FFCC00" />