import React, { useState } from 'react'; import { UploadCloud, FileText, Settings, ArrowRight, CheckCircle2 } from 'lucide-react'; import { motion } from 'framer-motion'; import axios from 'axios'; import { API_BASE_URL } from '../config'; const UploadView = ({ onUploadComplete }) => { const [resume, setResume] = useState(null); const [excel, setExcel] = useState(null); const [smtpEmail, setSmtpEmail] = useState(""); const [smtpPassword, setSmtpPassword] = useState(""); const [loading, setLoading] = useState(false); const handleUpload = async () => { if (!resume || !excel) { alert("Please provide both Resume and Excel files."); return; } setLoading(true); const formData = new FormData(); formData.append("resume", resume); formData.append("company_excel", excel); try { const res = await axios.post(`${API_BASE_URL}/upload`, formData); // Pass minimal data needed for generator + generic SMTP creds storage (in state) onUploadComplete({ ...res.data, smtpEmail, smtpPassword }); } catch (err) { console.error(err); alert("Upload failed."); } finally { setLoading(false); } }; return (
Upload your data sources to initialize the AI agent.