Spaces:
Paused
Paused
File size: 89,687 Bytes
028f096 6b2f36c 272b49c 6b2f36c 272b49c aa58c7d 6b2f36c 028f096 c282866 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 1fa1225 95243f9 6b2f36c c282866 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c d9fc36c 028f096 1fa1225 028f096 95243f9 028f096 95243f9 6b2f36c 6c2d0ad aa58c7d 028f096 6c2d0ad 1fa1225 6c2d0ad 1fa1225 028f096 6b2f36c 028f096 1fa1225 4300801 1fa1225 028f096 6b2f36c 028f096 6b2f36c 6c2d0ad 6b2f36c 6c2d0ad 6b2f36c 028f096 95243f9 028f096 95243f9 028f096 6c2d0ad 028f096 95243f9 028f096 95243f9 028f096 95243f9 028f096 6c2d0ad 6b2f36c 95243f9 6b2f36c 028f096 6b2f36c 028f096 6b2f36c 028f096 6b2f36c c282866 6c2d0ad c282866 6c2d0ad c282866 6c2d0ad 6b2f36c 6c2d0ad 028f096 95243f9 028f096 4077a72 c282866 4077a72 028f096 bee7763 c282866 4077a72 1d80adf 95243f9 4077a72 1d80adf 4300801 c282866 4077a72 95243f9 6c2d0ad 1d80adf 4077a72 028f096 1d80adf 028f096 4077a72 6c2d0ad 1d80adf 4077a72 272b49c 6c2d0ad 4077a72 6c2d0ad 272b49c 4077a72 6c2d0ad 272b49c 6c2d0ad c282866 6c2d0ad 4077a72 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 95243f9 6c2d0ad c282866 4077a72 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 4077a72 6c2d0ad 1d80adf 6c2d0ad 272b49c 4077a72 272b49c c282866 4077a72 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 4077a72 272b49c 4077a72 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 272b49c 95243f9 6c2d0ad 375b844 c282866 95243f9 272b49c 6c2d0ad 272b49c 95243f9 028f096 4077a72 1d80adf 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 028f096 95243f9 6c2d0ad 272b49c 6c2d0ad 272b49c 6c2d0ad 4077a72 6c2d0ad 4077a72 272b49c 6c2d0ad 4077a72 272b49c 6c2d0ad 95243f9 6c2d0ad 028f096 6b2f36c 504c45c 6b2f36c 504c45c 6b2f36c 504c45c 6b2f36c c282866 504c45c 1d80adf 6b2f36c 6c2d0ad 4077a72 272b49c 6c2d0ad 6b2f36c 4077a72 7b38420 6b2f36c 7b38420 272b49c 7b38420 4077a72 6b2f36c 7b38420 6b2f36c 7b38420 6b2f36c 7b38420 6c2d0ad 6b2f36c 272b49c 6b2f36c 7b38420 6b2f36c 7b38420 6c2d0ad 7b38420 504c45c 4077a72 6b2f36c 4077a72 1d80adf 4077a72 1d80adf 4077a72 1d80adf 4077a72 1d80adf 4077a72 1d80adf 4077a72 1d80adf 4077a72 6b2f36c 4077a72 7b38420 4077a72 1d80adf 4077a72 c282866 4077a72 1d80adf 4077a72 6b2f36c 4077a72 7b38420 4077a72 1d80adf 4077a72 c282866 1d80adf 4077a72 6c2d0ad 4077a72 6c2d0ad 4077a72 1d80adf 4077a72 1d80adf 6c2d0ad 4077a72 1d80adf 6c2d0ad 1d80adf 4077a72 6b2f36c 6c2d0ad 6b2f36c 7b38420 504c45c 4077a72 1d80adf 4077a72 7b38420 4077a72 6b2f36c 6c2d0ad 4077a72 6c2d0ad 4077a72 1d80adf 6b2f36c 4077a72 272b49c 4077a72 272b49c 4077a72 272b49c 6b2f36c 4077a72 1d80adf 4077a72 6b2f36c 4077a72 6b2f36c 4077a72 6c2d0ad 6b2f36c aa58c7d 504c45c 6c2d0ad aa58c7d 7b38420 aa58c7d 7b38420 aa58c7d 7b38420 aa58c7d 7b38420 aa58c7d 6b2f36c aa58c7d 1d80adf aa58c7d 7b38420 aa58c7d 7b38420 aa58c7d 7b38420 6c2d0ad 7b38420 aa58c7d 6c2d0ad aa58c7d 7b38420 aa58c7d 7b38420 6c2d0ad aa58c7d 7b38420 6c2d0ad aa58c7d 7b38420 6c2d0ad aa58c7d 1d80adf 7b38420 6b2f36c aa58c7d 7b38420 aa58c7d 7b38420 6b2f36c aa58c7d 7b38420 6c2d0ad 7b38420 aa58c7d 6c2d0ad 7b38420 aa58c7d 7b38420 6c2d0ad aa58c7d 7b38420 aa58c7d 7b38420 aa58c7d 7b38420 6c2d0ad aa58c7d 6c2d0ad aa58c7d 6c2d0ad aa58c7d 6c2d0ad 6b2f36c 232c47a 028f096 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 | '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>
);
};
|