Files
opencode-manager/frontend/src/hooks/useRepoBranches.ts
T
Chris Scott 27860224dc refactor(ui): unify branch pickers into searchable BranchCombobox
Rename BaseBranchSelect to BranchCombobox and rebuild it on the shared
Combobox with an include filter, configurable remote prefixing, and
clearing. Add a useRepoBranches hook and migrate the worktree, integrate,
multi-run, and schedule dialogs onto it. Expose id and ARIA listbox/option
roles from Combobox, and add bg-background to the form prompt panels.
2026-10-04 16:34:22 -04:00

12 lines
344 B
TypeScript

import { useQuery } from '@tanstack/react-query'
import { listBranches } from '@/api/repos'
export function useRepoBranches(repoId: number | undefined, enabled = true) {
return useQuery({
queryKey: ['branches', repoId],
queryFn: () => listBranches(repoId!),
enabled: enabled && repoId !== undefined,
staleTime: 30000,
})
}