import React, { useState, useEffect } from 'react'; import { ShieldCheck, AlertTriangle, Newspaper, Send, Search, Image as ImageIcon, CheckCircle, ShieldAlert, FileText, Lock, Mail, Phone, ChevronRight, X, User, Menu, FileUp, Info, ChevronDown, Facebook, Twitter, Instagram, Youtube } from 'lucide-react'; const translations = { en: { home: "Home", about: "About Us", contact: "Contact", alerts: "Latest Fraud Alerts", news: "Latest News", report: "Report Fraud", admin: "Admin", heroTitle: "Be Aware. Be Safe. Stop Fraud.", heroSub: "Together for a Fraud-Free India", navReport: "Report Fraud Now", nameLabel: "Your Name", descLabel: "Detailed Description", evidenceLabel: "Upload Evidence (Max 1MB)", submitBtn: "Submit Report", readMore: "Read More", sendBtn: "Send Message", footerText: "Dedicated to protecting citizens from cyber and offline fraud.", langSelect: "Select Language" }, hi: { home: "होम", about: "हमारे बारे में", contact: "संपर्क करें", alerts: "नवीनतम धोखाधड़ी अलर्ट", news: "नवीनतम समाचार", report: "धोखाधड़ी की रिपोर्ट करें", admin: "व्यवस्थापक", heroTitle: "जागरूक रहें। सुरक्षित रहें। धोखाधड़ी रोकें।", heroSub: "धोखाधड़ी मुक्त भारत के लिए एक साथ", navReport: "अभी धोखाधड़ी की रिपोर्ट करें", nameLabel: "आपका नाम", descLabel: "विस्तृत विवरण", evidenceLabel: "सबूत अपलोड करें (अधिकतम 1MB)", submitBtn: "रिपोर्ट जमा करें", readMore: "और पढ़ें", sendBtn: "संदेश भेजें", footerText: "नागरिकों को साइबर और ऑफ़लाइन धोखाधड़ी से बचाने के लिए समर्पित।", langSelect: "भाषा चुनें" }, te: { home: "హోమ్", about: "మా గురించి", contact: "సంప్రదించండి", alerts: "తాజా మోసాల హెచ్చరికలు", news: "తాజా వార్తలు", report: "మోసాన్ని నివేదించండి", admin: "నిర్వాహకుడు", heroTitle: "జాగ్రత్తగా ఉండండి. సురక్షితంగా ఉండండి. మోసాన్ని అరికట్టండి.", heroSub: "మోస రహిత భారతదేశం కోసం కలిసి", navReport: "ఇప్పుడే మోసాన్ని నివేదించండి", nameLabel: "మీ పేరు", descLabel: "వివరణాత్మక వర్ణన", evidenceLabel: "ఆధారాలను అప్లోడ్ చేయండి", submitBtn: "నివేదిక సమర్పించండి", readMore: "ఇంకా చదవండి", sendBtn: "సందేశం పంపండి", footerText: "పౌరులను సైబర్ మరియు ఆఫ్లైన్ మోసాల నుండి రక్షించడానికి అంకితం చేయబడింది.", langSelect: "భాషను ఎంచుకోండి" }, ta: { home: "முகப்பு", about: "எங்களை பற்றி", contact: "தொடர்பு கொள்ள", alerts: "சமீபத்திய மோசடி எச்சரிக்கைகள்", news: "சமீபத்திய செய்திகள்", report: "மோசடியை புகாரளி", admin: "நிர்வாகி", heroTitle: "விழிப்புடன் இருங்கள். பாதுகாப்பாக இருங்கள்.", heroSub: "மோசடி இல்லாத இந்தியாவுக்காக இணைந்து", navReport: "இப்போதே மோசடியை புகாரளி", nameLabel: "உங்கள் பெயர்", descLabel: "விரிவான விளக்கம்", evidenceLabel: "ஆதாரங்களை பதிவேற்றவும்", submitBtn: "அறிக்கையை சமர்ப்பிக்கவும்", readMore: "மேலும் படிக்க", sendBtn: "செய்தி அனுப்பவும்", footerText: "குடிமக்களை சைபர் மற்றும் ஆஃப்லைன் மோசடிகளிலிருந்து பாதுகாக்க அர்ப்பணிக்கப்பட்டுள்ளது.", langSelect: "மொழியைத் தேர்ந்தெடுக்கவும்" }, kn: { home: "ಮುಖಪುಟ", about: "ನಮ್ಮ ಬಗ್ಗೆ", contact: "ಸಂಪರ್ಕಿಸಿ", alerts: "ಇತ್ತೀಚಿನ ವಂಚನೆ ಎಚ್ಚರಿಕೆಗಳು", news: "ಇತ್ತೀಚಿನ ಸುದ್ದಿಗಳು", report: "ವಂಚನೆ ವರದಿ ಮಾಡಿ", admin: "ನಿರ್ವಾಹಕ", heroTitle: "ಎಚ್ಚರದಿಂದಿರಿ. ಸುರಕ್ಷಿತವಾಗಿರಿ. ವಂಚನೆ ತಡೆಯಿರಿ.", heroSub: "ವಂಚನೆ ಮುಕ್ತ ಭಾರತಕ್ಕಾಗಿ ಒಟ್ಟಾಗಿ", navReport: "ಈಗಲೇ ವಂಚನೆ ವರದಿ ಮಾಡಿ", nameLabel: "ನಿಮ್ಮ ಹೆಸರು", descLabel: "ವಿವರವಾದ ವಿವರಣೆ", evidenceLabel: "ಸಾಕ್ಷ್ಯವನ್ನು ಅಪ್ಲೋಡ್ ಮಾಡಿ", submitBtn: "ವರದಿ ಸಲ್ಲಿಸಿ", readMore: "ಮತ್ತಷ್ಟು ಓದಿ", sendBtn: "ಸಂದೇಶ ಕಳುಹಿಸಿ", footerText: "ನಾಗರಿಕರನ್ನು ಸೈಬರ್ ಮತ್ತು ಆಫ್ಲೈನ್ ವಂಚನೆಗಳಿಂದ ರಕ್ಷಿಸಲು ಸಮರ್ಪಿಸಲಾಗಿದೆ.", langSelect: "ಭಾಷೆ ಆಯ್ಕೆಮಾಡಿ" } }; export default function App() { const [currentView, setCurrentView] = useState('home'); const [lang, setLang] = useState('en'); const t = translations[lang] || translations['en']; const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const [isScrolled, setIsScrolled] = useState(false); // Local Storage DB State const [posts, setPosts] = useState(() => { const saved = localStorage.getItem('baif_posts'); return saved ? JSON.parse(saved) : []; }); const [complaints, setComplaints] = useState(() => { const saved = localStorage.getItem('baif_complaints'); return saved ? JSON.parse(saved) : []; }); const [sliderImages, setSliderImages] = useState(() => { const saved = localStorage.getItem('baif_slider'); return saved ? JSON.parse(saved) : [ { id: '1', url: 'https://images.unsplash.com/photo-1563986768609-322da13575f3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1400&q=80', title: 'Protect Your Data' }, { id: '2', url: 'https://images.unsplash.com/photo-1614064641913-a53b15680334?ixlib=rb-1.2.1&auto=format&fit=crop&w=1400&q=80', title: 'Cyber Security Awareness' }, { id: '3', url: 'https://images.unsplash.com/photo-1550751827-4bd374c3f58b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1400&q=80', title: 'Secure Transactions' } ]; }); // Save to local storage on change useEffect(() => { localStorage.setItem('baif_posts', JSON.stringify(posts)); }, [posts]); useEffect(() => { localStorage.setItem('baif_complaints', JSON.stringify(complaints)); }, [complaints]); useEffect(() => { localStorage.setItem('baif_slider', JSON.stringify(sliderImages)); }, [sliderImages]); // Admin Login State const [isAdmin, setIsAdmin] = useState(() => localStorage.getItem('baif_isAdmin') === 'true'); const [loginId, setLoginId] = useState(''); const [loginPassword, setLoginPassword] = useState(''); const [loginError, setLoginError] = useState(''); // Security State const [failedAttempts, setFailedAttempts] = useState(() => parseInt(localStorage.getItem('baif_failedAttempts') || '0', 10)); const [lockoutUntil, setLockoutUntil] = useState(() => parseInt(localStorage.getItem('baif_lockoutUntil') || '0', 10)); // Admin Form State const [newPostTitle, setNewPostTitle] = useState(''); const [newPostContent, setNewPostContent] = useState(''); const [newPostType, setNewPostType] = useState('alert'); const [newPostImage, setNewPostImage] = useState(''); const [newSliderUrl, setNewSliderUrl] = useState(''); const [newSliderTitle, setNewSliderTitle] = useState(''); // Complaint Form State const [complaintName, setComplaintName] = useState(''); const [complaintDesc, setComplaintDesc] = useState(''); const [complaintContact, setComplaintContact] = useState(''); // Slider State const [currentSlide, setCurrentSlide] = useState(0); const [isSliderPaused, setIsSliderPaused] = useState(false); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 20); }; window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, []); useEffect(() => { // Stop the interval if paused or if there aren't enough images to slide if (sliderImages.length <= 1 || isSliderPaused) return; const interval = setInterval(() => { setCurrentSlide((prev) => (prev + 1) % sliderImages.length); }, 15000); // Increased delay to 15 seconds for a much slower, comfortable pace return () => clearInterval(interval); }, [sliderImages.length, isSliderPaused]); const handleLogin = (e) => { e.preventDefault(); const now = Date.now(); if (lockoutUntil > now) { const minutesLeft = Math.ceil((lockoutUntil - now) / 60000); setLoginError(`Account locked. Try again in ${minutesLeft} minutes.`); return; } if (loginId === '9611182045' && loginPassword === 'Hardik@123') { setIsAdmin(true); localStorage.setItem('baif_isAdmin', 'true'); setLoginError(''); setFailedAttempts(0); localStorage.setItem('baif_failedAttempts', '0'); localStorage.setItem('baif_lockoutUntil', '0'); } else { const newAttempts = failedAttempts + 1; setFailedAttempts(newAttempts); localStorage.setItem('baif_failedAttempts', newAttempts.toString()); if (newAttempts === 3) { const lockoutTime = now + (5 * 60 * 1000); // 5 mins setLockoutUntil(lockoutTime); localStorage.setItem('baif_lockoutUntil', lockoutTime.toString()); setLoginError("Too many failed attempts. Locked out for 5 minutes."); } else if (newAttempts === 4) { const lockoutTime = now + (30 * 60 * 1000); // 30 mins setLockoutUntil(lockoutTime); localStorage.setItem('baif_lockoutUntil', lockoutTime.toString()); setLoginError("Account locked out for 30 minutes."); } else if (newAttempts >= 5) { const lockoutTime = now + (4 * 60 * 60 * 1000); // 4 hours setLockoutUntil(lockoutTime); localStorage.setItem('baif_lockoutUntil', lockoutTime.toString()); setLoginError("Account locked out for 4 hours."); } else { setLoginError(`Invalid ID or Password. Attempt ${newAttempts}/3 before first lockout.`); } } }; const handleLogout = () => { setIsAdmin(false); localStorage.removeItem('baif_isAdmin'); }; const handlePostSubmit = (e) => { e.preventDefault(); const newPost = { id: Date.now().toString(), title: newPostTitle, content: newPostContent, type: newPostType, imageUrl: newPostImage, date: new Date().toLocaleDateString(), lang: 'en' // Default post language }; setPosts(prev => { const updatedPosts = [newPost, ...prev]; // Ensure only 5 posts are kept if (updatedPosts.length > 5) { return updatedPosts.slice(0, 5); } return updatedPosts; }); setNewPostTitle(''); setNewPostContent(''); setNewPostImage(''); alert("Post Added successfully! Older posts automatically removed to keep maximum at 5."); }; const handleSliderFileChange = (e) => { const file = e.target.files[0]; if (file) { if (file.size > 2 * 1024 * 1024) { // 2MB max size alert("Image is too large. Please select a file under 2MB to save storage space."); return; } const reader = new FileReader(); reader.onloadend = () => { setNewSliderUrl(reader.result); // Save as Base64 string }; reader.readAsDataURL(file); } }; const handleSliderAdd = (e) => { e.preventDefault(); if (!newSliderUrl) { alert("Please upload an image first."); return; } const newSlide = { id: Date.now().toString(), url: newSliderUrl, title: newSliderTitle }; setSliderImages(prev => [...prev, newSlide]); setNewSliderUrl(''); setNewSliderTitle(''); }; const handleSliderDelete = (id) => { setSliderImages(prev => prev.filter(img => img.id !== id)); }; const handleComplaintSubmit = (e) => { e.preventDefault(); const newComplaint = { id: Date.now().toString(), name: complaintName, description: complaintDesc, contact: complaintContact, date: new Date().toLocaleDateString() }; setComplaints([newComplaint, ...complaints]); setComplaintName(''); setComplaintDesc(''); setComplaintContact(''); alert("Complaint Submitted. We will review it shortly."); }; const handleDeletePost = (id) => { setPosts(posts.filter(post => post.id !== id)); }; const renderAdmin = () => { if (!isAdmin) { return (
Note: Only the 5 most recent posts are kept active.
No active posts.
}| Date | Name | Contact | Description |
|---|---|---|---|
| {comp.date} | {comp.name} | {comp.contact} | {comp.description} |
| No complaints received yet. | |||
{t.heroSub}
{post.content}
No recent updates available at this time.
Our services are completely free. We never ask for money to help victims.
Your information is handled securely and only used to assist in fraud resolution.
Contact our helpline or submit a report online anytime you face suspicious activity.
Be Aware India Foundation is a free public service initiative dedicated to helping people stay safe from any kind of online or offline fraud.
We assist victims by guiding them through the complaint process, supporting follow-ups, and taking action where possible, so that individuals are not alone in dealing with fraud cases. Our team provides both online and offline assistance, completely free of charge.
Important: We do not ask for money, and no one needs to pay anything in our name.
The foundation is sustained through advertising revenue. Donations are entirely voluntary and never expected. If you would like to support our mission, you may contribute, but there is absolutely no obligation. These voluntary contributions help us maintain the website, resources, and outreach programs.
At Be Aware India Foundation, our mission is to build a safer, more aware India where every individual is protected from online and offline fraud. We are committed to spreading awareness, educating people about emerging scams, and guiding victims through the right complaint process so they can take the necessary steps towards resolution.
We believe that no one should suffer because of a lack of information or support. Our goal is to empower every citizen with the knowledge to recognize, prevent, and respond to fraud confidently. Through awareness campaigns, educational resources, and community support, we are working towards one clear vision: Zero Fraud in India.
Together, we can create a future where every citizen is informed, alert, and protected.
(Team Be Aware India foundation)
Email Us
support@beawareindia.com
Helpline (24/7)
+91 83 6060 5454
Emergency
Dial 1930 for National Cyber Crime
Your voluntary contributions help us maintain our resources, servers, and continue providing absolutely free assistance to fraud victims across India. No obligation, just appreciation.
Scan to Donate via UPI
beawareindia@upi
Your report helps us take action and protect others.