mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
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.
12 lines
344 B
TypeScript
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,
|
|
})
|
|
}
|