'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 (
{/* Hero Section */} 🕷️

Code Crawler

AI-powered codebase assistant. Upload your project and start exploring.

{/* Upload Zone */} { e.preventDefault(); setIsDragging(true); }} onDragLeave={() => setIsDragging(false)} onDrop={handleDrop} className={` w-full max-w-2xl p-12 rounded-2xl border-2 border-dashed transition-all duration-300 cursor-pointer ${isDragging ? 'border-sky-400 bg-sky-500/10 scale-105' : 'border-slate-600 hover:border-sky-500/50 hover:bg-slate-800/30' } `} > {isUploading ? (

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" />
)}
{/* Features */} {[ { icon: '💬', label: 'Chat' }, { icon: '🔍', label: 'Search' }, { icon: '🔧', label: 'Refactor' }, { icon: '✨', label: 'Generate' }, ].map((feature, i) => ( {feature.icon} {feature.label} ))}
); }