import { useState } from 'react'; import { Upload, Image as ImageIcon, Loader2, Shield } from 'lucide-react'; import { Button } from './ui/button'; import { Card } from './ui/card'; import { API_BASE_URL } from '../config'; interface UploadSectionProps { onAnalyze: (imageUrl: string) => void; isAnalyzing: boolean; } const SAMPLE_IMAGES = [ { id: '1', name: 'Urgency & Scarcity Checkout', url: `${API_BASE_URL}/api/samples/checkout_urgency.png`, description: 'Fintech checkout with a countdown timer, fake spot scarcity, live-viewer social proof and a confirmshaming opt-out.' }, { id: '2', name: 'Confirmshaming Cancellation', url: `${API_BASE_URL}/api/samples/cancel_confirmshaming.png`, description: 'Subscription cancellation modal using guilt-inducing copy, loss framing and a buried 6-step cancel flow.' }, { id: '3', name: 'Pre-Selected Fees Signup', url: `${API_BASE_URL}/api/samples/signup_sneaking.png`, description: 'Loan account signup with pre-checked paid add-ons, a trial that silently converts, and sneaked data sharing.' } ]; export function UploadSection({ onAnalyze, isAnalyzing }: UploadSectionProps) { const [selectedSample, setSelectedSample] = useState(null); const [uploadedImage, setUploadedImage] = useState(null); const handleFileUpload = (event: React.ChangeEvent) => { const file = event.target.files?.[0]; if (file) { const reader = new FileReader(); reader.onload = (e) => { const result = e.target?.result as string; setUploadedImage(result); setSelectedSample(null); }; reader.readAsDataURL(file); } }; const handleSampleSelect = (url: string) => { setSelectedSample(url); setUploadedImage(null); }; const handleAnalyze = () => { const imageUrl = uploadedImage || selectedSample; if (imageUrl) { onAnalyze(imageUrl); } }; const activeImage = uploadedImage || selectedSample; return (
{/* Glow overlay */}

Audit New UI Interface

{/* Upload Area (Fits target image directly inside) */}
{/* Sample Images */}

Select Fintech Sample Screen

{SAMPLE_IMAGES.map((sample) => ( ))}
{/* Analyze Button */}
); }