import { useQuery } from "@tanstack/react-query"; import OpenHands from "#/api/open-hands"; import { Branch } from "#/types/git"; export const useRepositoryBranches = (repository: string | null) => useQuery({ queryKey: ["repository", repository, "branches"], queryFn: async () => { if (!repository) return []; return OpenHands.getRepositoryBranches(repository); }, enabled: !!repository, staleTime: 1000 * 60 * 5, // 5 minutes });