import React, { useState, useRef } from 'react'; import { GitBranch, UploadCloud, Link2, Lock, FileArchive, Cpu, Sparkles, ArrowRight } from 'lucide-react'; const EXAMPLE_REPOS = [ 'https://github.com/pallets/flask', 'https://github.com/tiangolo/fastapi', 'https://github.com/django/django', ]; export default function InputForm({ onSubmit, loading }) { const [inputType, setInputType] = useState('url'); const [repoUrl, setRepoUrl] = useState(''); const [token, setToken] = useState(''); const [apiKey, setApiKey] = useState(''); const [zipFile, setZipFile] = useState(null); const [dragActive, setDragActive] = useState(false); const fileInputRef = useRef(null); const handleDrag = (e) => { e.preventDefault(); e.stopPropagation(); setDragActive(e.type === 'dragenter' || e.type === 'dragover'); }; const handleDrop = (e) => { e.preventDefault(); e.stopPropagation(); setDragActive(false); const file = e.dataTransfer.files?.[0]; if (file?.name.endsWith('.zip')) setZipFile(file); else if (file) alert('Only .zip archives are supported.'); }; const handleFileChange = (e) => { const file = e.target.files?.[0]; if (file?.name.endsWith('.zip')) setZipFile(file); else if (file) alert('Only .zip archives are supported.'); }; const handleSubmit = (e) => { e.preventDefault(); if (inputType === 'url') { if (!repoUrl.trim()) return; onSubmit({ type: 'url', url: repoUrl.trim(), token, apiKey: apiKey.trim() }); } else { if (!zipFile) return; onSubmit({ type: 'zip', file: zipFile, apiKey: apiKey.trim() }); } }; const canSubmit = inputType === 'url' ? !!repoUrl.trim() : !!zipFile; return (
{/* Hero */}
Powered by Gemini 2.5 Flash + RAG

Understand any codebase
in seconds

Analyze repositories, map architecture, extract APIs, and build a semantic knowledge base ready for AI agents โ€” no setup required.

{/* Card */}
{/* Input Type Toggle */}
{inputType === 'url' ? ( <>
setRepoUrl(e.target.value)} disabled={loading} id="repo-url-input" />
setToken(e.target.value)} disabled={loading} id="github-token-input" />
setApiKey(e.target.value)} disabled={loading} id="gemini-api-key-input" />
{/* Example repos */}
Try an example
{EXAMPLE_REPOS.map(url => ( ))}
) : (
fileInputRef.current?.click()} id="zip-drop-zone" > {zipFile ? (

{zipFile.name}

{(zipFile.size / (1024 * 1024)).toFixed(2)} MB ยท Click to change

) : (

Drop your .zip file here

or click to browse files

)}
)}
{/* Features strip */}
{[ { icon: '๐Ÿ—', title: 'Architecture Map', desc: 'Auto-detect patterns, entry points, and data flows' }, { icon: '๐Ÿ”', title: 'Semantic Search', desc: 'RAG-powered search across indexed code knowledge' }, { icon: '๐Ÿค–', title: 'AI Agents', desc: 'Multi-agent Q&A with confidence scoring' }, ].map(f => (
{f.icon}
{f.title}
{f.desc}
))}
); }