// The spawn form's worktree section (#61): create-worktree toggle, then // (once a base repo is known) new-branch-vs-existing-branch, mirroring // spawnForm.ts's `.adv-group`/`.wt-body`/`.wt-mode` markup. import type { BranchInfo } from "../../types.js"; import type { WorktreeBranchMode } from "./model.js"; export interface BranchPickerProps { enabled: boolean; onToggleEnabled(enabled: boolean): void; /** Status line shown in place of the body — "Checking…", "not a repo", * "choose a directory first". `null` once the body itself can render. */ hint: string | null; /** The repo a worktree would branch from, once resolved. */ baseRepo: string | null; mode: WorktreeBranchMode; onModeChange(mode: WorktreeBranchMode): void; newBranch: string; onNewBranchChange(value: string): void; /** This cwd's local branches, or `undefined` while unknown/not yet loaded. */ branches: BranchInfo[] | undefined; existingBranch: string; onExistingBranchChange(value: string): void; } export function BranchPicker(props: BranchPickerProps) { return (
{props.hint}
} {props.enabled && !props.hint && (repo: {props.baseRepo}
)}