interface BranchSelectorProps { repoName: string; branches: string[]; tags?: string[]; currentRef: string; view: "tree" | "commits" | "blob"; /** subpath for tree, full file path for blob */ path?: string; } export function BranchSelector({ repoName, branches, tags = [], currentRef, view, path, }: BranchSelectorProps) { if (branches.length === 0 && tags.length === 0) return ""; const isDetached = !branches.includes(currentRef) && !tags.includes(currentRef); const shortRef = isDetached && currentRef.length > 8 ? currentRef.slice(0, 8) : currentRef; return (
); }