import type { KeyboardEvent } from "react"; import type { OAuthStatus } from "../../api/client"; import { ProjectPathInput } from "./ProjectPathInput.tsx"; import { RecentProjectsList } from "./RecentProjectsList.tsx"; export interface RecentProjectMatch { name: string; path: string; } export interface SelectionScreenProps { knownProjects: string[]; onOpenProject: (path: string) => void; onForgetProject: (path: string) => void; pathInput: string; homeDir?: string | null; onPathInputChange: (value: string) => void; onPathInputKeyDown: (event: KeyboardEvent) => void; isOpening: boolean; suggestionTail: string; matchList: RecentProjectMatch[]; selectedMatch: number; onSelectMatch: (index: number) => void; onAcceptMatch: (path: string) => void; onCloseSuggestions: () => void; completionError: string | null; currentPartial: string; oauthStatus?: OAuthStatus | null; } export function SelectionScreen({ knownProjects, onOpenProject, onForgetProject, pathInput, homeDir, onPathInputChange, onPathInputKeyDown, isOpening, suggestionTail, matchList, selectedMatch, onSelectMatch, onAcceptMatch, onCloseSuggestions, completionError, currentPartial, oauthStatus = null, }: SelectionScreenProps) { const resolvedHomeDir = homeDir ? homeDir.endsWith("/") ? homeDir : `${homeDir}/` : ""; return (

Huskies

Paste or complete a project path to start.

{oauthStatus !== null && (
{!oauthStatus.authenticated || oauthStatus.expired ? ( ) : ( ✓ Authenticated with Claude )}
)} {knownProjects.length > 0 && ( )}
Press Tab to complete the next path segment
{completionError && (
{completionError}
)}
); }