GitHub repository
(optional)
{connected ? (
{username ? `@${username}` : t`Connected`}
) : connected === false ? (
) : null}
{showManualInput || connected === false ? (
onChange(e.target.value)}
placeholder="https://github.com/organization/repository"
spellCheck={false}
className="text-ui-body-sm"
/>
{value ? (
) : null}
) : null}
{connected && !showManualInput ? (
{/* Active selection banner if a repo is currently selected */}
{selectedRepo ? (
{selectedRepo.isPrivate ? (
) : (
)}
{selectedRepo.fullName}
) : null}
{/* Mini-search input */}
setSearchQuery(e.target.value)}
placeholder={t`Search repositories...`}
disabled={disabled || loading}
className="pl-8 h-8 text-ui-body-sm"
/>
{loading ? (
) : null}
{/* Repositories list */}
{loading && repos.length === 0 ? (
) : filteredRepos.length === 0 ? (
{searchQuery ? (
No matching repositories
) : (
No repositories found
)}
) : (
filteredRepos.map((repo) => {
const isSelected =
value.toLowerCase() === repo.url.toLowerCase() ||
value.replace(/\.git$/, "").toLowerCase() ===
repo.url.replace(/\.git$/, "").toLowerCase();
return (
);
})
)}
) : null}
);
}