import { useState, useEffect, useRef } from "react"; const LANGUAGES = [ { code: "en", label: "English", flag: "🇬🇧" }, { code: "es", label: "Spanish", flag: "🇪🇸" }, { code: "fr", label: "French", flag: "🇫🇷" }, { code: "de", label: "German", flag: "🇩🇪" }, { code: "ar", label: "Arabic", flag: "🇸🇦" }, { code: "zh", label: "Chinese", flag: "🇨🇳" }, { code: "ja", label: "Japanese", flag: "🇯🇵" }, { code: "pt", label: "Portuguese", flag: "🇧🇷" }, { code: "ur", label: "Urdu", flag: "🇵🇰" }, { code: "hi", label: "Hindi", flag: "🇮🇳" }, ]; const SEASONS = ["Spring", "Summer", "Autumn", "Winter", "New Year", "Eid", "Christmas", "Diwali", "Hanukkah", "Ramadan"]; const GREETING_TEMPLATES = { en: { Spring: "Wishing you a blooming Spring filled with fresh opportunities and success!", Summer: "May this Summer bring you warmth, joy, and incredible achievements!", Autumn: "As the leaves turn, may your career flourish with golden opportunities this Autumn!", Winter: "Warm wishes this Winter season — may your endeavors shine bright!", "New Year": "Happy New Year! Wishing you a year of breakthroughs and remarkable success!", Eid: "Eid Mubarak! May this blessed occasion bring peace and prosperity to you and your team!", Christmas: "Season's Greetings! Wishing you and yours a joyful and prosperous holiday!", Diwali: "Happy Diwali! May the Festival of Lights illuminate your path to success!", Hanukkah: "Happy Hanukkah! May the festival's glow light your way to wonderful opportunities!", Ramadan: "Ramadan Mubarak! May this holy month bring blessings, peace, and clarity to your journey!", }, es: { Spring: "¡Que esta primavera florezca con nuevas oportunidades y éxito para usted!", Summer: "¡Que este verano le traiga alegría, calidez y logros increíbles!", Autumn: "¡Que este otoño dore su camino con grandes oportunidades profesionales!", Winter: "¡Cálidos deseos en esta temporada invernal — que sus proyectos brillen!", "New Year": "¡Feliz Año Nuevo! ¡Que sea un año de grandes logros y éxitos!", Eid: "¡Eid Mubarak! ¡Que esta bendita ocasión traiga paz y prosperidad!", Christmas: "¡Feliz Navidad! ¡Les deseamos unas fiestas llenas de alegría y prosperidad!", Diwali: "¡Feliz Diwali! ¡Que el Festival de las Luces ilumine su camino al éxito!", Hanukkah: "¡Feliz Janucá! ¡Que la luz de la festividad alumbre su camino!", Ramadan: "¡Ramadán Mubarak! ¡Que este mes sagrado traiga bendiciones y paz!", }, fr: { Spring: "Que ce printemps vous apporte de nouvelles opportunités et un succès éclatant!", Summer: "Que cet été vous comble de chaleur, de joie et de succès remarquables!", Autumn: "Que cet automne dore votre parcours de merveilleuses opportunités!", Winter: "Chaleureuses salutations en cette saison hivernale — que vos projets brillent!", "New Year": "Bonne Année! Que cette année soit synonyme de réussites et d'accomplissements!", Eid: "Eid Mubarak! Que cette occasion bénie vous apporte paix et prospérité!", Christmas: "Joyeux Noël! Que les fêtes vous apportent joie et bonheur!", Diwali: "Joyeux Diwali! Que la Fête des Lumières éclaire votre chemin vers le succès!", Hanukkah: "Joyeux Hanoukka! Que la lumière de la fête guide vos pas!", Ramadan: "Ramadan Mubarak! Que ce mois béni vous apporte paix et sérénité!", }, de: { Spring: "Möge dieser Frühling neue Chancen und Erfolg für Sie bringen!", Summer: "Möge dieser Sommer Ihnen Wärme, Freude und tolle Erfolge bringen!", Autumn: "Möge dieser Herbst Ihren Weg mit goldenen Chancen erhellen!", Winter: "Herzliche Grüße in dieser Winterzeit — mögen Ihre Vorhaben glänzen!", "New Year": "Frohes Neues Jahr! Möge es ein Jahr voller Durchbrüche und Erfolge werden!", Eid: "Eid Mubarak! Möge dieser gesegnete Anlass Frieden und Wohlstand bringen!", Christmas: "Frohe Weihnachten! Mögen die Festtage Ihnen Freude und Glück bringen!", Diwali: "Frohes Diwali! Möge das Lichterfest Ihren Weg zum Erfolg erhellen!", Hanukkah: "Frohes Chanukka! Möge das Licht des Festes Ihren Weg weisen!", Ramadan: "Ramadan Mubarak! Möge dieser heilige Monat Segen und Frieden bringen!" }, ar: { Spring: "نتمنى لك ربيعاً مزهراً مليئاً بالفرص والنجاح!", Summer: "أتمنى أن يجلب هذا الصيف لك الدفء والفرح والإنجازات!", Autumn: "مع تحول أوراق الشجر، أتمنى أن تزهر مسيرتك بفرص ذهبية!", Winter: "أطيب التمنيات في هذا الشتاء — لتضيء مساعيك كالنجوم!", "New Year": "سنة جديدة سعيدة! أتمنى لك عاماً مليئاً بالنجاحات والإنجازات!", Eid: "عيد مبارك! أتمنى أن تجلب هذه المناسبة المباركة السلام والرخاء!", Christmas: "أطيب التحيات! أتمنى لكم أعياداً مليئة بالبهجة والازدهار!", Diwali: "عيد ديوالي سعيد! لتنير الأضواء دربك نحو النجاح!", Hanukkah: "عيد حانوكا سعيد! لتنير أضواء العيد طريقك!", Ramadan: "رمضان مبارك! أتمنى أن يجلب هذا الشهر الكريم البركة والسلام!" }, zh: { Spring: "祝您春意盎然,新机遇不断,事业更上一层楼!", Summer: "愿这个夏天给您带来温暖、欢乐和辉煌成就!", Autumn: "金秋时节,愿您的事业如丰收般充实!", Winter: "寒冬暖意,祝您的事业闪耀光辉!", "New Year": "新年快乐!愿新的一年充满突破与成功!", Eid: "开斋节快乐!愿这个吉祥时刻带来和平与繁荣!", Christmas: "圣诞快乐!愿节日充满欢乐与幸福!", Diwali: "排灯节快乐!愿光明节点亮您通往成功之路!", Hanukkah: "光明节快乐!愿节日的光芒指引您的道路!", Ramadan: "斋月吉祥!愿这个神圣的月份带来祝福与平安!" }, ja: { Spring: "新春を迎え、新たな機会と成功に満ちた素晴らしい春をお祈り申し上げます!", Summer: "この夏が温かみ、喜び、そして素晴らしい成果をもたらしますように!", Autumn: "実りの秋、あなたのキャリアが黄金の機会で輝きますように!", Winter: "この冬の季節に温かいご挨拶を申し上げます。", "New Year": "明けましておめでとうございます!今年が突破口と成功に満ちた年になりますように!", Eid: "イード・ムバーラク!この祝福された機会が平和と繁栄をもたらしますように!", Christmas: "メリークリスマス!素晴らしい休日をお過ごしください!", Diwali: "ディワリおめでとうございます!光の祭りが成功への道を照らしますように!", Hanukkah: "ハヌカーおめでとうございます!祭りの光があなたの道を照らしますように!", Ramadan: "ラマダン・ムバーラク!この神聖な月が祝福と平和をもたらしますように!" }, pt: { Spring: "Que esta primavera floresça com novas oportunidades e sucesso para você!", Summer: "Que este verão lhe traga calor, alegria e conquistas incríveis!", Autumn: "Que este outono dore seu caminho com ótimas oportunidades profissionais!", Winter: "Afetuosas saudações neste inverno — que seus projetos brilhem!", "New Year": "Feliz Ano Novo! Que seja um ano de grandes realizações e sucesso!", Eid: "Eid Mubarak! Que esta ocasião abençoada traga paz e prosperidade!", Christmas: "Feliz Natal! Desejamos a todos ótimas festas cheias de alegria!", Diwali: "Feliz Diwali! Que o Festival das Luzes ilumine seu caminho para o sucesso!", Hanukkah: "Feliz Hanukkah! Que a luz da festa guie seus passos!", Ramadan: "Ramadan Mubarak! Que este mês sagrado traga bênçãos e paz!" }, ur: { Spring: "امید ہے یہ بہار آپ کے لیے نئے مواقع اور کامیابی لے کر آئے!", Summer: "یہ گرمیاں آپ کے لیے خوشی، گرمجوشی اور کامیابیاں لائیں!", Autumn: "خزاں کے موسم میں آپ کا کیریئر سنہری مواقع سے بھرا ہو!", Winter: "اس سرما میں گرم خواہشات — آپ کی کوششیں روشن رہیں!", "New Year": "نیا سال مبارک! یہ سال کامیابیوں اور ترقی سے بھرا ہو!", Eid: "عید مبارک! یہ مبارک موقع آپ کے لیے امن اور خوشحالی لائے!", Christmas: "موسم کی مبارکباد! آپ کو خوشیوں سے بھری چھٹیاں مبارک ہوں!", Diwali: "دیوالی مبارک! روشنیوں کا یہ تہوار آپ کی کامیابی کی راہ روشن کرے!", Hanukkah: "حنوکہ مبارک! تہوار کی روشنی آپ کی رہنمائی کرے!", Ramadan: "رمضان مبارک! یہ مقدس مہینہ برکت اور سکون لائے!" }, hi: { Spring: "यह बसंत आपके जीवन में नए अवसर और सफलता लाए!", Summer: "यह गर्मी आपको खुशी, उत्साह और शानदार उपलब्धियां दे!", Autumn: "इस शरद ऋतु में आपका करियर सुनहरे अवसरों से भरा हो!", Winter: "इस सर्दी में हार्दिक शुभकामनाएं — आपके प्रयास चमकते रहें!", "New Year": "नव वर्ष की हार्दिक शुभकामनाएं! यह वर्ष सफलताओं से भरा हो!", Eid: "ईद मुबारक! यह पवित्र अवसर आपके लिए शांति और समृद्धि लाए!", Christmas: "मेरी क्रिसमस! आपको खुशियों भरी छुट्टियां मुबारक!", Diwali: "हैप्पी दीवाली! रोशनी का यह त्योहार आपकी सफलता की राह जगमगाए!", Hanukkah: "हैप्पी हनुक्का! त्योहार की रोशनी आपका मार्ग प्रशस्त करे!", Ramadan: "रमज़ान मुबारक! यह पवित्र महीना आशीर्वाद और शांति लाए!" }, }; const SAMPLE_CONTACTS = [ { id: 1, name: "Senator Jane Mitchell", role: "U.S. Senator", email: "j.mitchell@senate.gov", phone: "+12025550101", country: "USA", category: "Government" }, { id: 2, name: "Dr. Carlos Rivera", role: "CEO, TechNova Inc.", email: "crivera@technova.com", phone: "+34911234567", country: "Spain", category: "Corporate" }, { id: 3, name: "Priya Sharma", role: "Director, UN Development", email: "p.sharma@un.org", phone: "+919876543210", country: "India", category: "NGO" }, { id: 4, name: "Mark Thompson", role: "CFO, GlobalBank", email: "m.thompson@globalbank.com", phone: "+442071234567", country: "UK", category: "Finance" }, { id: 5, name: "Aisha Al-Rashid", role: "Minister of Innovation", email: "a.alrashid@gov.ae", phone: "+97142345678", country: "UAE", category: "Government" }, { id: 6, name: "Pierre Dubois", role: "Ambassador to France", email: "p.dubois@embassy.fr", phone: "+33123456789", country: "France", category: "Diplomatic" }, ]; const MOCK_SCRAPED = [ { name: "Rep. Sarah Chen", role: "House Representative", email: "s.chen@house.gov", phone: "+12025550202", country: "USA", category: "Government" }, { name: "CEO Michael Park", role: "Founder, AI Horizons", email: "mpark@aihorizons.io", phone: "+18005550303", country: "USA", category: "Corporate" }, { name: "Ambassador Liu Wei", role: "UN Special Envoy", email: "l.wei@un.org", phone: "+8610012345678", country: "China", category: "Diplomatic" }, ]; const SCHEDULE_OPTIONS = ["Every Hour", "Every 6 Hours", "Daily at 9 AM", "Weekly on Monday", "Monthly 1st", "On Special Occasions"]; export default function App() { const [dark, setDark] = useState(true); const [activeTab, setActiveTab] = useState("contacts"); const [contacts, setContacts] = useState(SAMPLE_CONTACTS); const [selectedContacts, setSelectedContacts] = useState([]); const [scrapeUrl, setScrapeUrl] = useState(""); const [scraping, setScraping] = useState(false); const [scrapeResults, setScrapeResults] = useState([]); const [scrapeProgress, setScrapeProgress] = useState(0); const [selectedLang, setSelectedLang] = useState("en"); const [selectedSeason, setSelectedSeason] = useState("New Year"); const [customMessage, setCustomMessage] = useState(""); const [useCustom, setUseCustom] = useState(false); const [sending, setSending] = useState(false); const [sendProgress, setSendProgress] = useState(0); const [sentLog, setSentLog] = useState([]); const [schedule, setSchedule] = useState("Daily at 9 AM"); const [scheduledJobs, setScheduledJobs] = useState([]); const [showAddContact, setShowAddContact] = useState(false); const [newContact, setNewContact] = useState({ name: "", role: "", email: "", phone: "", country: "", category: "Corporate" }); const [filterCat, setFilterCat] = useState("All"); const [notification, setNotification] = useState(null); const [msgChannel, setMsgChannel] = useState("email"); const [animateCards, setAnimateCards] = useState(false); const intervalRef = useRef(null); useEffect(() => { setTimeout(() => setAnimateCards(true), 100); }, [activeTab]); const showNotif = (msg, type = "success") => { setNotification({ msg, type }); setTimeout(() => setNotification(null), 3500); }; const handleScrape = () => { if (!scrapeUrl.trim()) return showNotif("Please enter a URL to scrape", "error"); setScraping(true); setScrapeProgress(0); setScrapeResults([]); let prog = 0; const iv = setInterval(() => { prog += Math.random() * 18 + 5; setScrapeProgress(Math.min(prog, 95)); if (prog >= 95) { clearInterval(iv); setTimeout(() => { setScrapeProgress(100); setScrapeResults(MOCK_SCRAPED); setScraping(false); showNotif(`✅ Scraped ${MOCK_SCRAPED.length} contacts from ${scrapeUrl}`); }, 400); } }, 200); }; const importScraped = () => { const newOnes = scrapeResults.map((c, i) => ({ ...c, id: Date.now() + i })); setContacts(prev => [...prev, ...newOnes]); setScrapeResults([]); setScrapeUrl(""); showNotif(`Imported ${newOnes.length} contacts!`); }; const toggleSelect = (id) => setSelectedContacts(prev => prev.includes(id) ? prev.filter(x => x !== id) : [...prev, id]); const selectAll = () => setSelectedContacts(contacts.map(c => c.id)); const clearSelect = () => setSelectedContacts([]); const getMessage = () => useCustom && customMessage ? customMessage : (GREETING_TEMPLATES[selectedLang]?.[selectedSeason] || "Warmest greetings and best wishes!"); const handleSend = async () => { if (!selectedContacts.length) return showNotif("Select at least one contact", "error"); setSending(true); setSendProgress(0); const toSend = contacts.filter(c => selectedContacts.includes(c.id)); const log = []; for (let i = 0; i < toSend.length; i++) { await new Promise(r => setTimeout(r, 350)); const contact = toSend[i]; const success = Math.random() > 0.1; log.push({ contact: contact.name, channel: msgChannel, status: success ? "Sent" : "Failed", time: new Date().toLocaleTimeString(), message: getMessage().substring(0, 60) + "..." }); setSendProgress(Math.round(((i + 1) / toSend.length) * 100)); } setSentLog(prev => [...log, ...prev]); setSending(false); showNotif(`📨 Messages sent to ${toSend.length} contacts!`); }; const addScheduledJob = () => { setScheduledJobs(prev => [...prev, { id: Date.now(), schedule, lang: selectedLang, season: selectedSeason, channel: msgChannel, contacts: selectedContacts.length, active: true, created: new Date().toLocaleDateString() }]); showNotif(`⏰ Scheduled: ${schedule}`); }; const deleteContact = (id) => { setContacts(prev => prev.filter(c => c.id !== id)); setSelectedContacts(prev => prev.filter(x => x !== id)); }; const addNewContact = () => { if (!newContact.name || !newContact.email) return showNotif("Name and email required", "error"); setContacts(prev => [...prev, { ...newContact, id: Date.now() }]); setNewContact({ name: "", role: "", email: "", phone: "", country: "", category: "Corporate" }); setShowAddContact(false); showNotif("Contact added!"); }; const filteredContacts = filterCat === "All" ? contacts : contacts.filter(c => c.category === filterCat); const categories = ["All", ...new Set(contacts.map(c => c.category))]; const t = dark ? { bg: "#0a0a0f", card: "#111118", border: "#1e1e2e", text: "#e8e8ff", sub: "#8888aa", accent: "#7c3aed", accent2: "#06b6d4", glow: "rgba(124,58,237,0.3)", inputBg: "#0d0d16", navBg: "#0d0d1a" } : { bg: "#f0f0ff", card: "#ffffff", border: "#ddddf0", text: "#1a1a2e", sub: "#666688", accent: "#7c3aed", accent2: "#0891b2", glow: "rgba(124,58,237,0.15)", inputBg: "#f8f8ff", navBg: "#ffffff" }; const styles = { root: { minHeight: "100vh", background: t.bg, color: t.text, fontFamily: "'Syne', 'Space Grotesk', sans-serif", transition: "all 0.4s ease", position: "relative", overflow: "hidden" }, noise: { position: "fixed", inset: 0, backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E")`, pointerEvents: "none", zIndex: 0, opacity: dark ? 1 : 0.5 }, orb1: { position: "fixed", width: 400, height: 400, borderRadius: "50%", background: `radial-gradient(circle, ${t.accent}22, transparent 70%)`, top: -100, right: -100, pointerEvents: "none", zIndex: 0, animation: "float1 8s ease-in-out infinite" }, orb2: { position: "fixed", width: 300, height: 300, borderRadius: "50%", background: `radial-gradient(circle, ${t.accent2}22, transparent 70%)`, bottom: 100, left: -80, pointerEvents: "none", zIndex: 0, animation: "float2 10s ease-in-out infinite" }, header: { position: "sticky", top: 0, zIndex: 100, background: t.navBg + "ee", borderBottom: `1px solid ${t.border}`, backdropFilter: "blur(20px)", padding: "12px 24px", display: "flex", alignItems: "center", justifyContent: "space-between" }, logo: { fontSize: 22, fontWeight: 900, letterSpacing: "-0.5px", background: `linear-gradient(135deg, ${t.accent}, ${t.accent2})`, WebkitBackgroundClip: "text", WebkitTextFillColor: "transparent" }, themeBtn: { width: 52, height: 28, borderRadius: 14, background: dark ? `linear-gradient(135deg, ${t.accent}, ${t.accent2})` : "#ddd", border: "none", cursor: "pointer", position: "relative", transition: "all 0.3s ease" }, thumbToggle: { position: "absolute", top: 3, left: dark ? 27 : 3, width: 22, height: 22, borderRadius: "50%", background: "#fff", transition: "all 0.3s cubic-bezier(0.34,1.56,0.64,1)", boxShadow: "0 2px 8px rgba(0,0,0,0.3)", display: "flex", alignItems: "center", justifyContent: "center", fontSize: 12 }, nav: { display: "flex", gap: 4, padding: "0 24px", borderBottom: `1px solid ${t.border}`, background: t.navBg + "cc", backdropFilter: "blur(12px)", zIndex: 90, flexWrap: "wrap" }, navBtn: (active) => ({ padding: "12px 18px", border: "none", background: "transparent", cursor: "pointer", fontSize: 13, fontWeight: active ? 700 : 500, color: active ? t.accent : t.sub, borderBottom: active ? `2px solid ${t.accent}` : "2px solid transparent", transition: "all 0.2s ease", letterSpacing: "0.3px" }), main: { maxWidth: 1100, margin: "0 auto", padding: "28px 20px", position: "relative", zIndex: 1 }, card: { background: t.card, border: `1px solid ${t.border}`, borderRadius: 16, padding: 24, marginBottom: 20, boxShadow: `0 4px 24px rgba(0,0,0,${dark ? 0.3 : 0.08})`, transition: "all 0.3s ease" }, input: { width: "100%", background: t.inputBg, border: `1px solid ${t.border}`, borderRadius: 10, padding: "10px 14px", color: t.text, fontSize: 14, outline: "none", transition: "border 0.2s", fontFamily: "inherit", boxSizing: "border-box" }, btn: (variant = "primary") => ({ padding: "10px 22px", borderRadius: 10, border: "none", cursor: "pointer", fontWeight: 700, fontSize: 13, letterSpacing: "0.3px", transition: "all 0.2s ease", fontFamily: "inherit", ...(variant === "primary" ? { background: `linear-gradient(135deg, ${t.accent}, ${t.accent2})`, color: "#fff", boxShadow: `0 4px 16px ${t.glow}` } : variant === "danger" ? { background: "#ef444420", color: "#ef4444", border: "1px solid #ef444440" } : { background: t.inputBg, color: t.text, border: `1px solid ${t.border}` }) }), badge: (cat) => { const colors = { Government: "#7c3aed", Corporate: "#06b6d4", NGO: "#10b981", Finance: "#f59e0b", Diplomatic: "#ec4899" }; return { display: "inline-block", padding: "2px 10px", borderRadius: 20, fontSize: 11, fontWeight: 700, background: (colors[cat] || "#888") + "22", color: colors[cat] || "#888", border: `1px solid ${(colors[cat] || "#888")}44` }; }, contactRow: { display: "flex", alignItems: "center", gap: 12, padding: "12px 16px", borderRadius: 12, border: `1px solid ${t.border}`, background: t.inputBg, marginBottom: 8, transition: "all 0.2s", cursor: "pointer" }, stat: { textAlign: "center", flex: 1 }, progressBar: (pct, color = t.accent) => ({ height: 6, borderRadius: 3, background: t.border, overflow: "hidden", margin: "8px 0", position: "relative" }), progressFill: (pct, color = t.accent) => ({ height: "100%", width: `${pct}%`, background: `linear-gradient(90deg, ${color}, ${t.accent2})`, borderRadius: 3, transition: "width 0.3s ease" }), grid2: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16 }, grid3: { display: "grid", gridTemplateColumns: "repeat(3,1fr)", gap: 12 }, label: { display: "block", fontSize: 12, fontWeight: 700, color: t.sub, marginBottom: 6, letterSpacing: "0.8px", textTransform: "uppercase" }, msgPreview: { background: t.inputBg, border: `1px solid ${t.accent}44`, borderRadius: 12, padding: 18, marginTop: 12, fontSize: 14, lineHeight: 1.7, color: t.text, fontStyle: "italic", position: "relative" }, chip: (active) => ({ padding: "6px 14px", borderRadius: 20, border: `1px solid ${active ? t.accent : t.border}`, background: active ? t.accent + "22" : "transparent", color: active ? t.accent : t.sub, cursor: "pointer", fontSize: 12, fontWeight: 600, transition: "all 0.2s" }), tag: { display: "inline-block", padding: "2px 8px", borderRadius: 6, background: t.accent + "15", color: t.accent, fontSize: 11, fontWeight: 700 }, }; const tabs = [ { id: "contacts", label: "📋 Contacts", }, { id: "scraper", label: "🔍 Web Scraper" }, { id: "composer", label: "✍️ Message Composer" }, { id: "sender", label: "📨 Send Campaigns" }, { id: "scheduler", label: "⏰ Scheduler" }, { id: "logs", label: "📊 Logs & Analytics" }, ]; return ( <>
{/* Notification */} {notification && (
{notification.msg}
)} {/* Header */}
🤝
MatchReach Agent
AI-Powered Outreach Platform
{contacts.length} contacts · {selectedContacts.length} selected
{dark ? "🌙" : "☀️"}
{/* Nav */}
{/* ===== CONTACTS TAB ===== */} {activeTab === "contacts" && (
{/* Stats */}
{[ { label: "Total Contacts", value: contacts.length, icon: "👥", color: t.accent }, { label: "Selected", value: selectedContacts.length, icon: "✅", color: "#10b981" }, { label: "Categories", value: categories.length - 1, icon: "🏷️", color: t.accent2 }, ].map((s, i) => (
{s.icon}
{s.value}
{s.label}
))}
{/* Actions */}
{categories.map(cat => ( setFilterCat(cat)}>{cat} ))}
{/* Add Contact Form */} {showAddContact && (
{[["name", "Full Name"], ["role", "Role / Title"], ["email", "Email"], ["phone", "Phone / WhatsApp"], ["country", "Country"]].map(([field, label]) => (
setNewContact(p => ({ ...p, [field]: e.target.value }))} placeholder={label} />
))}
)} {/* Contact List */}
{filteredContacts.map((c, i) => (
toggleSelect(c.id)}>
{selectedContacts.includes(c.id) && }
{c.category === "Government" ? "🏛️" : c.category === "Corporate" ? "💼" : c.category === "NGO" ? "🌍" : c.category === "Finance" ? "💰" : "🌐"}
{c.name}
{c.role} · {c.country}
📧 {c.email}
📱 {c.phone}
{c.category}
))}
)} {/* ===== SCRAPER TAB ===== */} {activeTab === "scraper" && (

🔍 Web Contact Scraper

Enter any website, directory, or LinkedIn page URL to automatically extract contact details.

setScrapeUrl(e.target.value)} placeholder="https://www.senate.gov/senators/ or any directory URL..." onKeyDown={e => e.key === "Enter" && handleScrape()} />
{scraping && (
⚙️ Extracting contacts... {Math.round(scrapeProgress)}%
Parsing HTML → Extracting emails & phones → Validating formats...
)} {scrapeResults.length > 0 && (

✅ {scrapeResults.length} Contacts Found

{scrapeResults.map((c, i) => (
🆕
{c.name}
{c.role}
{c.email}
{c.phone}
{c.category}
))}
)}

📌 Example Sources to Scrape

{[ ["🏛️ US Senate", "senate.gov/senators/"], ["🏢 Fortune 500 CEOs", "fortune.com/fortune500/"], ["🌐 UN Officials", "un.org/en/sections/about-un/"], ["📋 LinkedIn Directory", "linkedin.com/directory/"], ].map(([label, url]) => (
setScrapeUrl("https://" + url)}>
{label}
{url}
))}
)} {/* ===== COMPOSER TAB ===== */} {activeTab === "composer" && (

✍️ Greeting Message Composer

Custom
setUseCustom(!useCustom)}>
{LANGUAGES.find(l => l.code === selectedLang)?.flag}
"{getMessage()}"
{useCustom && (