/** * RepoAnalyzer * * Two input modes: * - "github" → GitHub URL (https://github.com/owner/repo) * - "local" → Select a local folder via the browser's native directory picker */ import { useState, useRef, useEffect, useId } from 'react'; import { Github, FolderOpen, Loader2, Check, ArrowRight, AlertCircle, Sparkles, } from '@/lib/lucide-icons'; import { startAnalyze, cancelAnalyze, streamAnalyzeProgress, type JobProgress, } from '../services/backend-client'; import { AnalyzeProgress } from './AnalyzeProgress'; // ── Helpers ────────────────────────────────────────────────────────────────── type InputMode = 'github' | 'local'; const GITHUB_RE = /^https?:\/\/(www\.)?github\.com\/[^/\s]+\/[^/\s]+/i; const IS_WINDOWS = navigator.userAgent.toLowerCase().includes('win'); function isValidGithubUrl(value: string): boolean { return GITHUB_RE.test(value.trim()); } // ── Mode tabs ──────────────────────────────────────────────────────────────── function ModeTabs({ mode, onChange }: { mode: InputMode; onChange: (m: InputMode) => void }) { return (
Analysis complete
{repoName}
Loading graph...