'use client'; import { motion } from 'framer-motion'; import { useState, useCallback } from 'react'; import { Upload, Folder, FileCode, ArrowRight, Loader2 } from 'lucide-react'; export default function HomePage() { const [isDragging, setIsDragging] = useState(false); const [isUploading, setIsUploading] = useState(false); const [uploadProgress, setUploadProgress] = useState(0); const handleDrop = useCallback((e: React.DragEvent) => { e.preventDefault(); setIsDragging(false); const files = e.dataTransfer.files; if (files.length > 0) { handleUpload(files[0]); } }, []); const handleUpload = async (file: File) => { setIsUploading(true); // Simulate progress for (let i = 0; i <= 100; i += 10) { await new Promise(r => setTimeout(r, 200)); setUploadProgress(i); } // TODO: Actually upload to backend setTimeout(() => { setIsUploading(false); window.location.href = '/chat'; }, 500); }; return (
AI-powered codebase assistant. Upload your project and start exploring.
Processing codebase...
{uploadProgress}%
Drop your project here
or click to select a ZIP file
e.target.files?.[0] && handleUpload(e.target.files[0])} className="hidden" id="file-input" />