diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index a2a3b4c..081e767 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -6,6 +6,7 @@ export default function Page() { + ) } diff --git a/apps/web/components/modes.tsx b/apps/web/components/modes.tsx new file mode 100644 index 0000000..779d9fb --- /dev/null +++ b/apps/web/components/modes.tsx @@ -0,0 +1,171 @@ +"use client" + +import { useState } from "react" +import { cn } from "@/lib/utils" + +const modes = [ + { + flag: "default", + label: "Default", + command: "explainthisrepo facebook/react", + description: "Full repository explanation written to EXPLAIN.md", + output: [ + "Fetching repository data...", + "Analyzing file tree and structure...", + "Reading high-signal files...", + "", + "React is a JavaScript library for building user", + "interfaces using a component-based architecture...", + "", + "EXPLAIN.md created successfully.", + ], + }, + { + flag: "--quick", + label: "Quick", + command: "explainthisrepo facebook/react --quick", + description: "One-sentence summary printed to terminal", + output: [ + "Fetching repository data...", + "", + "React is a declarative JavaScript library for", + "building composable user interfaces.", + ], + }, + { + flag: "--detailed", + label: "Detailed", + command: "explainthisrepo facebook/react --detailed", + description: "Deeper explanation including architecture and structure", + output: [ + "Fetching repository data...", + "Analyzing file tree and structure...", + "Reading high-signal files...", + "Building architecture map...", + "", + "React is a UI library using a fiber-based reconciler.", + "Core packages: react, react-dom, react-reconciler.", + "Architecture: virtual DOM with concurrent rendering.", + "", + "EXPLAIN.md created successfully.", + ], + }, + { + flag: "--simple", + label: "Simple", + command: "explainthisrepo facebook/react --simple", + description: "Short, easy explanation printed to terminal", + output: [ + "Fetching repository data...", + "", + "React helps you build websites by breaking the UI", + "into reusable pieces called components.", + ], + }, + { + flag: "--stack", + label: "Stack", + command: "explainthisrepo facebook/react --stack", + description: "Tech stack breakdown from repo signals. No AI.", + output: [ + "Detecting stack from repo signals...", + "", + "Languages: JavaScript, TypeScript, C++", + "Build: Rollup, Gradle", + "Testing: Jest", + "CI/CD: GitHub Actions, CircleCI", + "Package: Yarn workspaces (monorepo)", + ], + }, +] + +export function Modes() { + const [activeMode, setActiveMode] = useState(0) + const mode = modes[activeMode] + + return ( + + + + + Modes + + + Multiple ways to understand a repo + + + Choose the right level of detail. From a one-liner to a full + architectural breakdown. + + + + + {/* Mode selector */} + + {modes.map((m, index) => ( + setActiveMode(index)} + className={cn( + "flex-shrink-0 rounded-lg px-4 py-3 text-left transition-all", + index === activeMode + ? "bg-secondary border border-primary/30 text-foreground" + : "text-muted-foreground hover:text-foreground hover:bg-secondary/50" + )} + > + + + {m.flag} + + + {m.description} + + ))} + + + {/* Terminal preview */} + + + + + + + + {mode.label.toLowerCase()} + + + + + $ {mode.command} + + + {mode.output.map((line, i) => ( + + {line || "\u00A0"} + + ))} + + + + + + + + ) +}
+ Modes +
+ Choose the right level of detail. From a one-liner to a full + architectural breakdown. +
+ {m.flag} +
{m.description}