BranchSelect
import { BranchSelect, branchName } from '@hanzo/ui/product'
The branch a run starts from
Rows may be bare names or `{ name }`, whichever the host's API answers.
main
export function Default() {const [branch, setBranch] = useState('main')return (<XStack pt={240}><BranchSelect value={branch} onChange={setBranch} load={async (q) => ({ branches: BRANCHES.filter((b) => b.includes(q)).map((name) => ({ name })) })} /></XStack>)}
Types
export type Branch = string | { name: string }
export type BranchLoad = (q: string, after?: string | null) => Promise<{ branches: Branch[]; next?: string | null }>
export interface BranchSelectProps {/** The chosen branch. */value?: string | nullonChange: (branch: string) => voidload: BranchLoad/** Under the list — why a branch might be missing. */footer?: ReactNodeplacement?: ChipPlacementdisabled?: booleanopen?: booleanonOpenChange?: (open: boolean) => void}
Exports
BranchSelectbranchNametype Branchtype BranchLoadtype BranchSelectProps